mirror of
https://github.com/torvalds/linux
synced 2024-11-05 18:23:50 +00:00
HID: wacom: remove warning while disconnecting devices
When the LED class gets removed, it actually tries to reset the LED. However, the device being disconnected, the set_report fails. Previously, the attempt to cut lose this last event was through unsetting the HID drvdata, but it was not working properly. Simply reset the LED groups to NULL makes a more efficient solution. Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Acked-by: Jason Gerecke <jason.gerecke@wacom.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
This commit is contained in:
parent
5b779fc520
commit
c0265a9488
1 changed files with 2 additions and 3 deletions
|
@ -757,9 +757,6 @@ static int wacom_led_control(struct wacom *wacom)
|
|||
unsigned char report_id = WAC_CMD_LED_CONTROL;
|
||||
int buf_size = 9;
|
||||
|
||||
if (!hid_get_drvdata(wacom->hdev))
|
||||
return -ENODEV;
|
||||
|
||||
if (!wacom->led.groups)
|
||||
return -ENOTSUPP;
|
||||
|
||||
|
@ -2497,6 +2494,8 @@ static void wacom_remove(struct hid_device *hdev)
|
|||
if (hdev->bus == BUS_BLUETOOTH)
|
||||
device_remove_file(&hdev->dev, &dev_attr_speed);
|
||||
|
||||
/* make sure we don't trigger the LEDs */
|
||||
wacom_led_groups_release(wacom);
|
||||
wacom_release_resources(wacom);
|
||||
|
||||
hid_set_drvdata(hdev, NULL);
|
||||
|
|
Loading…
Reference in a new issue