Skip to content

Commit

Permalink
Input: cm109 - fix checking return value of usb_control_msg
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
axel lin authored and Dmitry Torokhov committed Aug 27, 2011
1 parent 1fab84a commit 7b727ac
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/input/misc/cm109.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit 7b727ac

Please sign in to comment.