Commit 242cf670 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

[PATCH] USB: fix up URB_ASYNC_UNLINK usages from the usb-serial drivers

Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent b375a049
...@@ -383,11 +383,8 @@ static int keyspan_write(struct usb_serial_port *port, ...@@ -383,11 +383,8 @@ static int keyspan_write(struct usb_serial_port *port,
dbg("%s - endpoint %d flip %d", __FUNCTION__, usb_pipeendpoint(this_urb->pipe), flip); dbg("%s - endpoint %d flip %d", __FUNCTION__, usb_pipeendpoint(this_urb->pipe), flip);
if (this_urb->status == -EINPROGRESS) { if (this_urb->status == -EINPROGRESS) {
if (this_urb->transfer_flags & URB_ASYNC_UNLINK)
break;
if (time_before(jiffies, p_priv->tx_start_time[flip] + 10 * HZ)) if (time_before(jiffies, p_priv->tx_start_time[flip] + 10 * HZ))
break; break;
this_urb->transfer_flags |= URB_ASYNC_UNLINK;
usb_unlink_urb(this_urb); usb_unlink_urb(this_urb);
break; break;
} }
...@@ -402,7 +399,6 @@ static int keyspan_write(struct usb_serial_port *port, ...@@ -402,7 +399,6 @@ static int keyspan_write(struct usb_serial_port *port,
/* send the data out the bulk port */ /* send the data out the bulk port */
this_urb->transfer_buffer_length = todo + dataOffset; this_urb->transfer_buffer_length = todo + dataOffset;
this_urb->transfer_flags &= ~URB_ASYNC_UNLINK;
this_urb->dev = port->serial->dev; this_urb->dev = port->serial->dev;
if ((err = usb_submit_urb(this_urb, GFP_ATOMIC)) != 0) { if ((err = usb_submit_urb(this_urb, GFP_ATOMIC)) != 0) {
dbg("usb_submit_urb(write bulk) failed (%d)", err); dbg("usb_submit_urb(write bulk) failed (%d)", err);
...@@ -1119,10 +1115,8 @@ static int keyspan_open (struct usb_serial_port *port, struct file *filp) ...@@ -1119,10 +1115,8 @@ static int keyspan_open (struct usb_serial_port *port, struct file *filp)
static inline void stop_urb(struct urb *urb) static inline void stop_urb(struct urb *urb)
{ {
if (urb && urb->status == -EINPROGRESS) { if (urb && urb->status == -EINPROGRESS)
urb->transfer_flags &= ~URB_ASYNC_UNLINK;
usb_kill_urb(urb); usb_kill_urb(urb);
}
} }
static void keyspan_close(struct usb_serial_port *port, struct file *filp) static void keyspan_close(struct usb_serial_port *port, struct file *filp)
......
...@@ -273,12 +273,9 @@ static int option_write(struct usb_serial_port *port, ...@@ -273,12 +273,9 @@ static int option_write(struct usb_serial_port *port,
this_urb = portdata->out_urbs[i]; this_urb = portdata->out_urbs[i];
if (this_urb->status == -EINPROGRESS) { if (this_urb->status == -EINPROGRESS) {
if (this_urb->transfer_flags & URB_ASYNC_UNLINK)
continue;
if (time_before(jiffies, if (time_before(jiffies,
portdata->tx_start_time[i] + 10 * HZ)) portdata->tx_start_time[i] + 10 * HZ))
continue; continue;
this_urb->transfer_flags |= URB_ASYNC_UNLINK;
usb_unlink_urb(this_urb); usb_unlink_urb(this_urb);
continue; continue;
} }
...@@ -293,7 +290,6 @@ static int option_write(struct usb_serial_port *port, ...@@ -293,7 +290,6 @@ static int option_write(struct usb_serial_port *port,
memcpy (this_urb->transfer_buffer, buf, todo); memcpy (this_urb->transfer_buffer, buf, todo);
this_urb->transfer_buffer_length = todo; this_urb->transfer_buffer_length = todo;
this_urb->transfer_flags &= ~URB_ASYNC_UNLINK;
this_urb->dev = port->serial->dev; this_urb->dev = port->serial->dev;
err = usb_submit_urb(this_urb, GFP_ATOMIC); err = usb_submit_urb(this_urb, GFP_ATOMIC);
if (err) { if (err) {
...@@ -513,10 +509,8 @@ static int option_open(struct usb_serial_port *port, struct file *filp) ...@@ -513,10 +509,8 @@ static int option_open(struct usb_serial_port *port, struct file *filp)
static inline void stop_urb(struct urb *urb) static inline void stop_urb(struct urb *urb)
{ {
if (urb && urb->status == -EINPROGRESS) { if (urb && urb->status == -EINPROGRESS)
urb->transfer_flags &= ~URB_ASYNC_UNLINK;
usb_kill_urb(urb); usb_kill_urb(urb);
}
} }
static void option_close(struct usb_serial_port *port, struct file *filp) static void option_close(struct usb_serial_port *port, struct file *filp)
......
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