HID: wacom: Unregister sysfs attributes on remove
authorDavid Herrmann <dh.herrmann@googlemail.com>
Mon, 5 Sep 2011 16:45:29 +0000 (18:45 +0200)
committerJiri Kosina <jkosina@suse.cz>
Wed, 7 Sep 2011 11:32:35 +0000 (13:32 +0200)
HID devices can be hotplugged so we should unregister all sysfs attributes when
removing a driver. Otherwise, manually unloading the wacom-driver will not
remove the sysfs attributes. Only when the device is disconnected, they are
removed, eventually.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
drivers/hid/hid-wacom.c

index f66a597cff6302410107d7ff2201d7486fc4008a..a597039d0755bd88d506f620287dcaa00b921519 100644 (file)
@@ -423,6 +423,7 @@ static void wacom_remove(struct hid_device *hdev)
 #ifdef CONFIG_HID_WACOM_POWER_SUPPLY
        struct wacom_data *wdata = hid_get_drvdata(hdev);
 #endif
+       device_remove_file(&hdev->dev, &dev_attr_speed);
        hid_hw_stop(hdev);
 
 #ifdef CONFIG_HID_WACOM_POWER_SUPPLY