From: Axel Lin <axel.lin@gmail.com>
To: linux-kernel@vger.kernel.org
Cc: "Alfred E. Heggestad" <aeh@db.org>,
Dmitry Torokhov <dmitry.torokhov@gmail.com>,
linux-input@vger.kernel.org
Subject: [PATCH] Input: cm109 - fix checking return value of usb_control_msg
Date: Thu, 25 Aug 2011 22:06:50 +0800 [thread overview]
Message-ID: <1314281210.5915.1.camel@phoenix> (raw)
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
next reply other threads:[~2011-08-25 14:07 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-25 14:06 Axel Lin [this message]
2011-08-27 6:29 ` [PATCH] Input: cm109 - fix checking return value of usb_control_msg Dmitry Torokhov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1314281210.5915.1.camel@phoenix \
--to=axel.lin@gmail.com \
--cc=aeh@db.org \
--cc=dmitry.torokhov@gmail.com \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox