summaryrefslogtreecommitdiffstats
path: root/drivers/usb/serial/mos7840.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-08-17 10:14:53 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2012-08-17 10:14:53 -0700
commit9134e7d2706a8954f216a9f11ef784e0f9ccd551 (patch)
treec3b2d64e35c432868688f61f9ff3105dd81bd99e /drivers/usb/serial/mos7840.c
parent0df7c0e3a73f5d12bca24d81ee5ed52947b372b6 (diff)
parent731879f8e3d4c61220462160311fa650a8b96abf (diff)
Merge tag 'usb-3.6-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb
Pull USB patches from Greg Kroah-Hartman: "Here are a number of small USB patches for 3.6-rc3. The "large" one is just a number of device id updates to the option driver, done by the manufacturer, properly fixing up the device ids based on shipping devices. Other than that, some gadget driver fixes, the obligitary XHCI patches, and some other device ids and bugs fixed. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>" * tag 'usb-3.6-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (26 commits) USB: qcserial: fix port handling on Gobi 1K and 2K+ USB: serial: Fix mos7840 timeout USB: option: add ZTE K5006-Z usb: gadget: u_ether: fix kworker 100% CPU issue with still used interfaces in eth_stop usb: host: tegra: fix warning messages in ehci_remove usb: host: mips: sead3: Update for EHCI register structure. usb: renesas_usbhs: fixup resume method for autonomy mode usb: renesas_usbhs: mod_host: add missing .bus_suspend/resume update MAINTAINERS for Oliver Neukum usb: usb_wwan: resume/suspend can be called after port is gone usb: serial: prevent suspend/resume from racing against probe/remove usb: usb_wwan: replace release and disconnect with a port_remove hook usb: serial: mos7840: Fixup mos7840_chars_in_buffer() USB: isp1362-hcd.c: usb message always saved in case of underrun OMAP: USB : Fix the EHCI enumeration and core retention issue usb: chipidea: fix and improve dependencies if usb host or gadget support is built as module USB: support the new interfaces of Huawei Data Card devices in option driver USB: ftdi_sio: Add VID/PID for Kondo Serial USB xhci: Switch PPT ports to EHCI on shutdown. xhci: Fix bug after deq ptr set to link TRB. ...
Diffstat (limited to 'drivers/usb/serial/mos7840.c')
-rw-r--r--drivers/usb/serial/mos7840.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/drivers/usb/serial/mos7840.c b/drivers/usb/serial/mos7840.c
index 57eca244842..2f6da1e89bf 100644
--- a/drivers/usb/serial/mos7840.c
+++ b/drivers/usb/serial/mos7840.c
@@ -82,8 +82,7 @@
* Defines used for sending commands to port
*/
-#define WAIT_FOR_EVER (HZ * 0) /* timeout urb is wait for ever */
-#define MOS_WDR_TIMEOUT (HZ * 5) /* default urb timeout */
+#define MOS_WDR_TIMEOUT 5000 /* default urb timeout */
#define MOS_PORT1 0x0200
#define MOS_PORT2 0x0300
@@ -1232,9 +1231,12 @@ static int mos7840_chars_in_buffer(struct tty_struct *tty)
return 0;
spin_lock_irqsave(&mos7840_port->pool_lock, flags);
- for (i = 0; i < NUM_URBS; ++i)
- if (mos7840_port->busy[i])
- chars += URB_TRANSFER_BUFFER_SIZE;
+ for (i = 0; i < NUM_URBS; ++i) {
+ if (mos7840_port->busy[i]) {
+ struct urb *urb = mos7840_port->write_urb_pool[i];
+ chars += urb->transfer_buffer_length;
+ }
+ }
spin_unlock_irqrestore(&mos7840_port->pool_lock, flags);
dbg("%s - returns %d", __func__, chars);
return chars;
@@ -1344,7 +1346,7 @@ static void mos7840_close(struct usb_serial_port *port)
static void mos7840_block_until_chase_response(struct tty_struct *tty,
struct moschip_port *mos7840_port)
{
- int timeout = 1 * HZ;
+ int timeout = msecs_to_jiffies(1000);
int wait = 10;
int count;
@@ -2672,7 +2674,7 @@ static int mos7840_startup(struct usb_serial *serial)
/* setting configuration feature to one */
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;
error:
for (/* nothing */; i >= 0; i--) {