[PATCH] HID: wacom: Add parse before start

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



It might be better to add  hid_parse() before
wacom_parse_and_register() to ask for the report descriptor
like what wacom_probe() does.

Fixes: 471d171 ("Input: wacom - move the USB (now hid) Wacom driver in drivers/hid")
Signed-off-by: Jiasheng Jiang <jiasheng@xxxxxxxxxxx>
---
 drivers/hid/wacom_sys.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/drivers/hid/wacom_sys.c b/drivers/hid/wacom_sys.c
index 57bfa0a..48cb2e4 100644
--- a/drivers/hid/wacom_sys.c
+++ b/drivers/hid/wacom_sys.c
@@ -2486,6 +2486,9 @@ static void wacom_wireless_work(struct work_struct *work)
 
 		wacom_wac1->pid = wacom_wac->pid;
 		hid_hw_stop(hdev1);
+		error = hid_parse(wacom1->hdev);
+		if (error)
+			goto fail;
 		error = wacom_parse_and_register(wacom1, true);
 		if (error)
 			goto fail;
@@ -2498,6 +2501,9 @@ static void wacom_wireless_work(struct work_struct *work)
 				*((struct wacom_features *)id->driver_data);
 			wacom_wac2->pid = wacom_wac->pid;
 			hid_hw_stop(hdev2);
+			error = hid_parse(wacom2->hdev);
+			if (error)
+				goto fail;
 			error = wacom_parse_and_register(wacom2, true);
 			if (error)
 				goto fail;
@@ -2710,12 +2716,18 @@ static void wacom_mode_change_work(struct work_struct *work)
 	}
 
 	if (wacom1) {
+		error = hid_parse(wacom1->hdev);
+		if (error)
+			return;
 		error = wacom_parse_and_register(wacom1, false);
 		if (error)
 			return;
 	}
 
 	if (wacom2) {
+		error = hid_parse(wacom2->hdev);
+		if (error)
+			return;
 		error = wacom_parse_and_register(wacom2, false);
 		if (error)
 			return;
-- 
2.7.4




[Index of Archives]     [Linux Media Devel]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Linux Wireless Networking]     [Linux Omap]

  Powered by Linux