* [PATCH] Input: cm109 - fix checking return value of usb_control_msg
@ 2011-08-25 14:06 Axel Lin
2011-08-27 6:29 ` Dmitry Torokhov
0 siblings, 1 reply; 2+ messages in thread
From: Axel Lin @ 2011-08-25 14:06 UTC (permalink / raw)
To: linux-kernel; +Cc: Alfred E. Heggestad, Dmitry Torokhov, linux-input
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>
---
drivers/input/misc/cm109.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/input/misc/cm109.c b/drivers/input/misc/cm109.c
index b09c7d1..b741338 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);
}
--
1.7.4.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] Input: cm109 - fix checking return value of usb_control_msg
2011-08-25 14:06 [PATCH] Input: cm109 - fix checking return value of usb_control_msg Axel Lin
@ 2011-08-27 6:29 ` Dmitry Torokhov
0 siblings, 0 replies; 2+ messages in thread
From: Dmitry Torokhov @ 2011-08-27 6:29 UTC (permalink / raw)
To: Axel Lin; +Cc: linux-kernel, Alfred E. Heggestad, linux-input
On Thu, Aug 25, 2011 at 10:06:50PM +0800, Axel Lin wrote:
> 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>
Applied, thanks Axel.
--
Dmitry
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-08-27 6:29 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-08-25 14:06 [PATCH] Input: cm109 - fix checking return value of usb_control_msg Axel Lin
2011-08-27 6:29 ` Dmitry Torokhov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).