aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenjamin Tissoires <benjamin.tissoires@redhat.com>2017-01-20 10:20:12 -0500
committerJiri Kosina <jkosina@suse.cz>2017-01-23 05:00:13 -0500
commitc0265a9488c2a3aea315b61a9239d5494997fa71 (patch)
tree61a1ddd65c1bf40258af481c3b15a235c96e7b82
parent5b779fc52020ac6f5beea31c5eafc3d25cf70dc1 (diff)
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>
-rw-r--r--drivers/hid/wacom_sys.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/hid/wacom_sys.c b/drivers/hid/wacom_sys.c
index 0a817e69e029..4c0fa3e7ea00 100644
--- a/drivers/hid/wacom_sys.c
+++ b/drivers/hid/wacom_sys.c
@@ -757,9 +757,6 @@ static int wacom_led_control(struct wacom *wacom)
757 unsigned char report_id = WAC_CMD_LED_CONTROL; 757 unsigned char report_id = WAC_CMD_LED_CONTROL;
758 int buf_size = 9; 758 int buf_size = 9;
759 759
760 if (!hid_get_drvdata(wacom->hdev))
761 return -ENODEV;
762
763 if (!wacom->led.groups) 760 if (!wacom->led.groups)
764 return -ENOTSUPP; 761 return -ENOTSUPP;
765 762
@@ -2497,6 +2494,8 @@ static void wacom_remove(struct hid_device *hdev)
2497 if (hdev->bus == BUS_BLUETOOTH) 2494 if (hdev->bus == BUS_BLUETOOTH)
2498 device_remove_file(&hdev->dev, &dev_attr_speed); 2495 device_remove_file(&hdev->dev, &dev_attr_speed);
2499 2496
2497 /* make sure we don't trigger the LEDs */
2498 wacom_led_groups_release(wacom);
2500 wacom_release_resources(wacom); 2499 wacom_release_resources(wacom);
2501 2500
2502 hid_set_drvdata(hdev, NULL); 2501 hid_set_drvdata(hdev, NULL);