Input: wacom - return proper error if usb_get_extra_descriptor() fails
authorDmitry Torokhov <dmitry.torokhov@gmail.com>
Wed, 2 May 2012 07:13:38 +0000 (00:13 -0700)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Wed, 2 May 2012 07:20:30 +0000 (00:20 -0700)
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>
drivers/input/tablet/wacom_sys.c

index 364f2c3432ff0042c06de41203db8f3edf990906..8f3b30b781fa2a01be3d43ece253172043988a28 100644 (file)
@@ -517,11 +517,12 @@ static int wacom_retrieve_hid_descriptor(struct usb_interface *intf,
                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;
                }
        }