From: Benjamin Tissoires Date: Fri, 12 Feb 2016 16:27:45 +0000 (+0100) Subject: HID: wacom: close the wireless receiver on remove() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=f6205161782fa325152340c8fe47c1b90105cfbc;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git HID: wacom: close the wireless receiver on remove() rmmod/insmod the wacom.ko module does not work for the receiver because it was not previously closed. Now, we can hack with the wireless receiver without having to unplug/replug it. Signed-off-by: Benjamin Tissoires Acked-by: Ping Cheng Signed-off-by: Jiri Kosina --- diff --git a/drivers/hid/wacom_sys.c b/drivers/hid/wacom_sys.c index 9a410351d56a..68a560957871 100644 --- a/drivers/hid/wacom_sys.c +++ b/drivers/hid/wacom_sys.c @@ -1853,6 +1853,11 @@ fail_parse: static void wacom_remove(struct hid_device *hdev) { struct wacom *wacom = hid_get_drvdata(hdev); + struct wacom_wac *wacom_wac = &wacom->wacom_wac; + struct wacom_features *features = &wacom_wac->features; + + if (features->device_type & WACOM_DEVICETYPE_WL_MONITOR) + hid_hw_close(hdev); hid_hw_stop(hdev);