From: Benjamin Tissoires <benjamin.tissoires@redhat.com>
To: Jiri Kosina <jikos@kernel.org>, Ping Cheng <pinglinux@gmail.com>,
Jason Gerecke <killertofu@gmail.com>,
Aaron Skomra <skomra@gmail.com>
Cc: linux-kernel@vger.kernel.org, linux-input@vger.kernel.org
Subject: [PATCH 2/4] HID: wacom: remove warning while disconnecting devices
Date: Fri, 20 Jan 2017 16:20:12 +0100 [thread overview]
Message-ID: <20170120152014.19775-3-benjamin.tissoires@redhat.com> (raw)
In-Reply-To: <20170120152014.19775-1-benjamin.tissoires@redhat.com>
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>
---
drivers/hid/wacom_sys.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/hid/wacom_sys.c b/drivers/hid/wacom_sys.c
index 734100a..4a2c88d 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)
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;
@@ -2495,6 +2492,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);
--
2.9.3
next prev parent reply other threads:[~2017-01-20 15:20 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-20 15:20 [PATCH 0/4] HID: wacom: fixes for next Benjamin Tissoires
2017-01-20 15:20 ` [PATCH 1/4] HID: wacom: release the resources before leaving despite devm Benjamin Tissoires
2017-01-20 15:20 ` Benjamin Tissoires [this message]
2017-01-20 15:20 ` [PATCH 3/4] HID: wacom: do not attempt to switch mode while in probe Benjamin Tissoires
2017-01-20 15:20 ` [PATCH 4/4] HID: wacom: do not shout an error on LED control Benjamin Tissoires
2017-01-21 2:31 ` Jason Gerecke
2017-01-21 2:35 ` [PATCH 0/4] HID: wacom: fixes for next Jason Gerecke
2017-01-23 8:02 ` Benjamin Tissoires
2017-01-23 10:01 ` Jiri Kosina
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170120152014.19775-3-benjamin.tissoires@redhat.com \
--to=benjamin.tissoires@redhat.com \
--cc=jikos@kernel.org \
--cc=killertofu@gmail.com \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pinglinux@gmail.com \
--cc=skomra@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).