From: axel lin Date: Thu, 25 Aug 2011 16:42:09 +0000 (-0700) Subject: Input: cm109 - fix checking return value of usb_control_msg X-Git-Tag: firefly_0821_release~176^2~541^2~386 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=7b727acc412c9320dc56a0fd7312febf8710ac0e;p=firefly-linux-kernel-4.4.55.git Input: cm109 - fix checking return value of usb_control_msg If successful, usb_control_msg returns the number of bytes transferred, otherwise a negative error number. Signed-off-by: Axel Lin Signed-off-by: Dmitry Torokhov --- diff --git a/drivers/input/misc/cm109.c b/drivers/input/misc/cm109.c index b09c7d127219..ab860511f016 100644 --- a/drivers/input/misc/cm109.c +++ b/drivers/input/misc/cm109.c @@ -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); }