Commit 1e658489 authored by Mark Ferrell's avatar Mark Ferrell Committed by Greg Kroah-Hartman

USB: serial: Fix mos7840 timeout

* mos7840 driver was using multiple of HZ for the timeout handed off to
  usb_control_msg().  Changed the timeout to use msecs instead.

* Remove unused WAIT_FOR_EVER definition
Signed-off-by: default avatarMark Ferrell <mferrell@uplogix.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent f1b5c997
...@@ -82,8 +82,7 @@ ...@@ -82,8 +82,7 @@
* Defines used for sending commands to port * Defines used for sending commands to port
*/ */
#define WAIT_FOR_EVER (HZ * 0) /* timeout urb is wait for ever */ #define MOS_WDR_TIMEOUT 5000 /* default urb timeout */
#define MOS_WDR_TIMEOUT (HZ * 5) /* default urb timeout */
#define MOS_PORT1 0x0200 #define MOS_PORT1 0x0200
#define MOS_PORT2 0x0300 #define MOS_PORT2 0x0300
...@@ -1347,7 +1346,7 @@ static void mos7840_close(struct usb_serial_port *port) ...@@ -1347,7 +1346,7 @@ static void mos7840_close(struct usb_serial_port *port)
static void mos7840_block_until_chase_response(struct tty_struct *tty, static void mos7840_block_until_chase_response(struct tty_struct *tty,
struct moschip_port *mos7840_port) struct moschip_port *mos7840_port)
{ {
int timeout = 1 * HZ; int timeout = msecs_to_jiffies(1000);
int wait = 10; int wait = 10;
int count; int count;
...@@ -2675,7 +2674,7 @@ static int mos7840_startup(struct usb_serial *serial) ...@@ -2675,7 +2674,7 @@ static int mos7840_startup(struct usb_serial *serial)
/* setting configuration feature to one */ /* setting configuration feature to one */
usb_control_msg(serial->dev, usb_sndctrlpipe(serial->dev, 0), usb_control_msg(serial->dev, usb_sndctrlpipe(serial->dev, 0),
(__u8) 0x03, 0x00, 0x01, 0x00, NULL, 0x00, 5 * HZ); (__u8) 0x03, 0x00, 0x01, 0x00, NULL, 0x00, MOS_WDR_TIMEOUT);
return 0; return 0;
error: error:
for (/* nothing */; i >= 0; i--) { for (/* nothing */; i >= 0; i--) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment