From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752876AbdATPUs (ORCPT ); Fri, 20 Jan 2017 10:20:48 -0500 Received: from mx1.redhat.com ([209.132.183.28]:48263 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752541AbdATPUq (ORCPT ); Fri, 20 Jan 2017 10:20:46 -0500 From: Benjamin Tissoires To: Jiri Kosina , Ping Cheng , Jason Gerecke , Aaron Skomra 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 Message-Id: <20170120152014.19775-3-benjamin.tissoires@redhat.com> In-Reply-To: <20170120152014.19775-1-benjamin.tissoires@redhat.com> References: <20170120152014.19775-1-benjamin.tissoires@redhat.com> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Fri, 20 Jan 2017 15:20:27 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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