Input: cm109 - fix checking return value of usb_control_msg
authoraxel lin <axel.lin@gmail.com>
Thu, 25 Aug 2011 16:42:09 +0000 (09:42 -0700)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Sat, 27 Aug 2011 06:20:30 +0000 (23:20 -0700)
If successful, usb_control_msg returns the number of bytes transferred,
otherwise a negative error number.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
drivers/input/misc/cm109.c

index b09c7d127219f19c4ae04b4a2ce545e639278d27..ab860511f01690a73ed2fd3dbefb49d11aaa3f73 100644 (file)
@@ -475,7 +475,7 @@ static void cm109_toggle_buzzer_sync(struct cm109_dev *dev, int on)
                                le16_to_cpu(dev->ctl_req->wIndex),
                                dev->ctl_data,
                                USB_PKT_LEN, USB_CTRL_SET_TIMEOUT);
-       if (error && error != EINTR)
+       if (error < 0 && error != -EINTR)
                err("%s: usb_control_msg() failed %d", __func__, error);
 }