diff options
author | Pavel Roskin <proski@gnu.org> | 2007-06-16 03:38:51 -0400 |
---|---|---|
committer | Guido Guenther <agx@sigxcpu.org> | 2007-06-16 13:42:58 +0200 |
commit | 3428d1e2efe75ec5a9d6e07b52e824e2ee244696 (patch) | |
tree | 37ba779e707d982b1bb70568827edb21bf2e8885 | |
parent | c0e47c434fd460c3eea3c13ade4add2e03d9b923 (diff) |
[PATCH] Use consistent timeout in usb_control_msg()
The timeout argument is in microseconds, not in jiffies. Use
USB_CTRL_GET_TIMEOUT in all usb_control_msg() calls. It's 5 seconds,
and should be enough even for the slowest devices.
Signed-off-by: Pavel Roskin <proski@gnu.org>
-rw-r--r-- | at76_usb.c | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -247,7 +247,7 @@ static int at76_dfu_download_block(struct dfu_ctx *ctx, u8 *buffer, int bytes, result = usb_control_msg(udev, usb_sndctrlpipe(udev, 0), DFU_DNLOAD, USB_TYPE_CLASS | USB_DIR_OUT | USB_RECIP_INTERFACE, block, 0, tmpbuf, bytes, - HZ); + USB_CTRL_GET_TIMEOUT); return result; } @@ -259,7 +259,8 @@ static int at76_dfu_get_status(struct dfu_ctx *ctx, struct dfu_status *status) result = usb_control_msg(udev, usb_rcvctrlpipe(udev, 0), DFU_GETSTATUS, USB_TYPE_CLASS | USB_DIR_IN | USB_RECIP_INTERFACE, 0, 0, status, - sizeof(struct dfu_status), HZ); + sizeof(struct dfu_status), + USB_CTRL_GET_TIMEOUT); return result; } @@ -269,7 +270,8 @@ static u8 at76_dfu_get_state(struct usb_device *udev, u8 *state) result = usb_control_msg(udev, usb_rcvctrlpipe(udev, 0), DFU_GETSTATE, USB_TYPE_CLASS | USB_DIR_IN | - USB_RECIP_INTERFACE, 0, 0, state, 1, HZ); + USB_RECIP_INTERFACE, 0, 0, state, 1, + USB_CTRL_GET_TIMEOUT); return result; } |