Commit 849513a7 authored by Johan Hovold's avatar Johan Hovold Committed by Greg Kroah-Hartman

USB: mos7720: fix message timeouts

The control and bulk-message timeouts are specified in milliseconds and
should not depend on HZ.

Cc: stable@vger.kernel.org
Signed-off-by: default avatarJohan Hovold <jhovold@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 6c13ff68
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
#define DRIVER_DESC "Moschip USB Serial Driver" #define DRIVER_DESC "Moschip USB Serial Driver"
/* default urb timeout */ /* default urb timeout */
#define MOS_WDR_TIMEOUT (HZ * 5) #define MOS_WDR_TIMEOUT 5000
#define MOS_MAX_PORT 0x02 #define MOS_MAX_PORT 0x02
#define MOS_WRITE 0x0E #define MOS_WRITE 0x0E
...@@ -1938,7 +1938,7 @@ static int mos7720_startup(struct usb_serial *serial) ...@@ -1938,7 +1938,7 @@ static int mos7720_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, 5000);
/* start the interrupt urb */ /* start the interrupt urb */
ret_val = usb_submit_urb(serial->port[0]->interrupt_in_urb, GFP_KERNEL); ret_val = usb_submit_urb(serial->port[0]->interrupt_in_urb, GFP_KERNEL);
...@@ -1981,7 +1981,7 @@ static void mos7720_release(struct usb_serial *serial) ...@@ -1981,7 +1981,7 @@ static void mos7720_release(struct usb_serial *serial)
/* wait for synchronous usb calls to return */ /* wait for synchronous usb calls to return */
if (mos_parport->msg_pending) if (mos_parport->msg_pending)
wait_for_completion_timeout(&mos_parport->syncmsg_compl, wait_for_completion_timeout(&mos_parport->syncmsg_compl,
MOS_WDR_TIMEOUT); msecs_to_jiffies(MOS_WDR_TIMEOUT));
parport_remove_port(mos_parport->pp); parport_remove_port(mos_parport->pp);
usb_set_serial_data(serial, NULL); usb_set_serial_data(serial, NULL);
......
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