41 lines
1.5 KiB
Diff
41 lines
1.5 KiB
Diff
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
|
|
Date: Wed, 2 May 2012 00:13:38 -0700
|
|
Subject: [PATCH 26/26] Input: wacom - return proper error if
|
|
usb_get_extra_descriptor() fails
|
|
|
|
commit a882c932a628cbab17752fc8b1c94692f95bbf9a upstream.
|
|
|
|
Instead of returning 1 (which is not even negative) let's capture and return
|
|
error codde returned by usb_get_extra_descriptor().
|
|
|
|
Reviewed-by: Chris Bagwell <chris@cnpbagwell.com>
|
|
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
|
|
[bwh: Adjust context to apply without preceding
|
|
commit 1963518b9b1b8019d33b4b08deee6f873ffa2730]
|
|
---
|
|
drivers/input/tablet/wacom_sys.c | 11 ++++++-----
|
|
1 file changed, 6 insertions(+), 5 deletions(-)
|
|
|
|
diff --git a/drivers/input/tablet/wacom_sys.c b/drivers/input/tablet/wacom_sys.c
|
|
index 364f2c343..8f3b30b 100644
|
|
--- a/drivers/input/tablet/wacom_sys.c
|
|
+++ b/drivers/input/tablet/wacom_sys.c
|
|
@@ -517,11 +517,12 @@ static int wacom_retrieve_hid_descriptor(struct usb_interface *intf,
|
|
(features->type != BAMBOO_PT))
|
|
goto out;
|
|
|
|
- if (usb_get_extra_descriptor(interface, HID_DEVICET_HID, &hid_desc)) {
|
|
- if (usb_get_extra_descriptor(&interface->endpoint[0],
|
|
- HID_DEVICET_REPORT, &hid_desc)) {
|
|
- printk("wacom: can not retrieve extra class descriptor\n");
|
|
- error = 1;
|
|
+ error = usb_get_extra_descriptor(interface, HID_DEVICET_HID, &hid_desc);
|
|
+ if (error) {
|
|
+ error = usb_get_extra_descriptor(&interface->endpoint[0],
|
|
+ HID_DEVICET_REPORT, &hid_desc);
|
|
+ if (error) {
|
|
+ printk(KERN_ERR "wacom: can not retrieve extra class descriptor\n");
|
|
goto out;
|
|
}
|
|
}
|