diff mbox

[2/2] HID: wacom: Unregister sysfs attributes on remove

Message ID 1315241129-3889-2-git-send-email-dh.herrmann@googlemail.com (mailing list archive)
State New, archived
Delegated to: Jiri Kosina
Headers show

Commit Message

David Herrmann Sept. 5, 2011, 4:45 p.m. UTC
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>
---
 drivers/hid/hid-wacom.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

Comments

Jiri Kosina Sept. 7, 2011, 11:36 a.m. UTC | #1
On Mon, 5 Sep 2011, David Herrmann wrote:

> 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>

Applied, thanks David.

> ---
>  drivers/hid/hid-wacom.c |    1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/hid/hid-wacom.c b/drivers/hid/hid-wacom.c
> index f66a597..a597039 100644
> --- a/drivers/hid/hid-wacom.c
> +++ b/drivers/hid/hid-wacom.c
> @@ -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
> -- 
> 1.7.6.1
>
diff mbox

Patch

diff --git a/drivers/hid/hid-wacom.c b/drivers/hid/hid-wacom.c
index f66a597..a597039 100644
--- a/drivers/hid/hid-wacom.c
+++ b/drivers/hid/hid-wacom.c
@@ -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