From ee9baa2dd8a8a5d99b6943707d32e32e0687f20d Mon Sep 17 00:00:00 2001 From: Felix Rueegg Date: Sun, 6 Oct 2013 17:59:56 +0200 Subject: Remove sysfs attributes when removing driver to prevent error when driver is loaded again. --- src/kernel/hid-lg-g710-plus.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/kernel/hid-lg-g710-plus.c b/src/kernel/hid-lg-g710-plus.c index 42ff7d8..57876d8 100644 --- a/src/kernel/hid-lg-g710-plus.c +++ b/src/kernel/hid-lg-g710-plus.c @@ -249,6 +249,11 @@ err_free: static void lg_g710_plus_remove(struct hid_device *hdev) { struct lg_g710_plus_data* data = lg_g710_plus_get_data(hdev); + struct list_head *feature_report_list = &hdev->report_enum[HID_FEATURE_REPORT].report_list; + + if (data != NULL && !list_empty(feature_report_list)) + sysfs_remove_group(&hdev->dev.kobj, &data->attr_group); + hid_hw_stop(hdev); if (data != NULL) { kfree(data); -- cgit v1.2.3