diff options
Diffstat (limited to 'drivers/usb/serial/mos7840.c')
-rw-r--r-- | drivers/usb/serial/mos7840.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/drivers/usb/serial/mos7840.c b/drivers/usb/serial/mos7840.c index 57eca2448424..2f6da1e89bfa 100644 --- a/drivers/usb/serial/mos7840.c +++ b/drivers/usb/serial/mos7840.c | |||
@@ -82,8 +82,7 @@ | |||
82 | * Defines used for sending commands to port | 82 | * Defines used for sending commands to port |
83 | */ | 83 | */ |
84 | 84 | ||
85 | #define WAIT_FOR_EVER (HZ * 0) /* timeout urb is wait for ever */ | 85 | #define MOS_WDR_TIMEOUT 5000 /* default urb timeout */ |
86 | #define MOS_WDR_TIMEOUT (HZ * 5) /* default urb timeout */ | ||
87 | 86 | ||
88 | #define MOS_PORT1 0x0200 | 87 | #define MOS_PORT1 0x0200 |
89 | #define MOS_PORT2 0x0300 | 88 | #define MOS_PORT2 0x0300 |
@@ -1232,9 +1231,12 @@ static int mos7840_chars_in_buffer(struct tty_struct *tty) | |||
1232 | return 0; | 1231 | return 0; |
1233 | 1232 | ||
1234 | spin_lock_irqsave(&mos7840_port->pool_lock, flags); | 1233 | spin_lock_irqsave(&mos7840_port->pool_lock, flags); |
1235 | for (i = 0; i < NUM_URBS; ++i) | 1234 | for (i = 0; i < NUM_URBS; ++i) { |
1236 | if (mos7840_port->busy[i]) | 1235 | if (mos7840_port->busy[i]) { |
1237 | chars += URB_TRANSFER_BUFFER_SIZE; | 1236 | struct urb *urb = mos7840_port->write_urb_pool[i]; |
1237 | chars += urb->transfer_buffer_length; | ||
1238 | } | ||
1239 | } | ||
1238 | spin_unlock_irqrestore(&mos7840_port->pool_lock, flags); | 1240 | spin_unlock_irqrestore(&mos7840_port->pool_lock, flags); |
1239 | dbg("%s - returns %d", __func__, chars); | 1241 | dbg("%s - returns %d", __func__, chars); |
1240 | return chars; | 1242 | return chars; |
@@ -1344,7 +1346,7 @@ static void mos7840_close(struct usb_serial_port *port) | |||
1344 | static void mos7840_block_until_chase_response(struct tty_struct *tty, | 1346 | static void mos7840_block_until_chase_response(struct tty_struct *tty, |
1345 | struct moschip_port *mos7840_port) | 1347 | struct moschip_port *mos7840_port) |
1346 | { | 1348 | { |
1347 | int timeout = 1 * HZ; | 1349 | int timeout = msecs_to_jiffies(1000); |
1348 | int wait = 10; | 1350 | int wait = 10; |
1349 | int count; | 1351 | int count; |
1350 | 1352 | ||
@@ -2672,7 +2674,7 @@ static int mos7840_startup(struct usb_serial *serial) | |||
2672 | 2674 | ||
2673 | /* setting configuration feature to one */ | 2675 | /* setting configuration feature to one */ |
2674 | usb_control_msg(serial->dev, usb_sndctrlpipe(serial->dev, 0), | 2676 | usb_control_msg(serial->dev, usb_sndctrlpipe(serial->dev, 0), |
2675 | (__u8) 0x03, 0x00, 0x01, 0x00, NULL, 0x00, 5 * HZ); | 2677 | (__u8) 0x03, 0x00, 0x01, 0x00, NULL, 0x00, MOS_WDR_TIMEOUT); |
2676 | return 0; | 2678 | return 0; |
2677 | error: | 2679 | error: |
2678 | for (/* nothing */; i >= 0; i--) { | 2680 | for (/* nothing */; i >= 0; i--) { |