diff options
author | Greg Kroah-Hartman <gregkh@suse.de> | 2005-07-29 16:11:07 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2005-09-08 19:27:55 -0400 |
commit | 242cf670c09c05504ce53dfc27f8331a072f169d (patch) | |
tree | ddd30f63ed128818c94f46c5d3134e2566e07633 /drivers/usb | |
parent | b375a0495fd622037560c73c05f23ae6f127bb0c (diff) |
[PATCH] USB: fix up URB_ASYNC_UNLINK usages from the usb-serial drivers
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb')
-rw-r--r-- | drivers/usb/serial/keyspan.c | 8 | ||||
-rw-r--r-- | drivers/usb/serial/option.c | 8 |
2 files changed, 2 insertions, 14 deletions
diff --git a/drivers/usb/serial/keyspan.c b/drivers/usb/serial/keyspan.c index fb0926292228..3b958e60f5e8 100644 --- a/drivers/usb/serial/keyspan.c +++ b/drivers/usb/serial/keyspan.c | |||
@@ -383,11 +383,8 @@ static int keyspan_write(struct usb_serial_port *port, | |||
383 | dbg("%s - endpoint %d flip %d", __FUNCTION__, usb_pipeendpoint(this_urb->pipe), flip); | 383 | dbg("%s - endpoint %d flip %d", __FUNCTION__, usb_pipeendpoint(this_urb->pipe), flip); |
384 | 384 | ||
385 | if (this_urb->status == -EINPROGRESS) { | 385 | if (this_urb->status == -EINPROGRESS) { |
386 | if (this_urb->transfer_flags & URB_ASYNC_UNLINK) | ||
387 | break; | ||
388 | if (time_before(jiffies, p_priv->tx_start_time[flip] + 10 * HZ)) | 386 | if (time_before(jiffies, p_priv->tx_start_time[flip] + 10 * HZ)) |
389 | break; | 387 | break; |
390 | this_urb->transfer_flags |= URB_ASYNC_UNLINK; | ||
391 | usb_unlink_urb(this_urb); | 388 | usb_unlink_urb(this_urb); |
392 | break; | 389 | break; |
393 | } | 390 | } |
@@ -402,7 +399,6 @@ static int keyspan_write(struct usb_serial_port *port, | |||
402 | /* send the data out the bulk port */ | 399 | /* send the data out the bulk port */ |
403 | this_urb->transfer_buffer_length = todo + dataOffset; | 400 | this_urb->transfer_buffer_length = todo + dataOffset; |
404 | 401 | ||
405 | this_urb->transfer_flags &= ~URB_ASYNC_UNLINK; | ||
406 | this_urb->dev = port->serial->dev; | 402 | this_urb->dev = port->serial->dev; |
407 | if ((err = usb_submit_urb(this_urb, GFP_ATOMIC)) != 0) { | 403 | if ((err = usb_submit_urb(this_urb, GFP_ATOMIC)) != 0) { |
408 | dbg("usb_submit_urb(write bulk) failed (%d)", err); | 404 | 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 | 1115 | ||
1120 | static inline void stop_urb(struct urb *urb) | 1116 | static inline void stop_urb(struct urb *urb) |
1121 | { | 1117 | { |
1122 | if (urb && urb->status == -EINPROGRESS) { | 1118 | if (urb && urb->status == -EINPROGRESS) |
1123 | urb->transfer_flags &= ~URB_ASYNC_UNLINK; | ||
1124 | usb_kill_urb(urb); | 1119 | usb_kill_urb(urb); |
1125 | } | ||
1126 | } | 1120 | } |
1127 | 1121 | ||
1128 | static void keyspan_close(struct usb_serial_port *port, struct file *filp) | 1122 | static void keyspan_close(struct usb_serial_port *port, struct file *filp) |
diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c index 4f985f43e79e..92d0f925d053 100644 --- a/drivers/usb/serial/option.c +++ b/drivers/usb/serial/option.c | |||
@@ -273,12 +273,9 @@ static int option_write(struct usb_serial_port *port, | |||
273 | 273 | ||
274 | this_urb = portdata->out_urbs[i]; | 274 | this_urb = portdata->out_urbs[i]; |
275 | if (this_urb->status == -EINPROGRESS) { | 275 | if (this_urb->status == -EINPROGRESS) { |
276 | if (this_urb->transfer_flags & URB_ASYNC_UNLINK) | ||
277 | continue; | ||
278 | if (time_before(jiffies, | 276 | if (time_before(jiffies, |
279 | portdata->tx_start_time[i] + 10 * HZ)) | 277 | portdata->tx_start_time[i] + 10 * HZ)) |
280 | continue; | 278 | continue; |
281 | this_urb->transfer_flags |= URB_ASYNC_UNLINK; | ||
282 | usb_unlink_urb(this_urb); | 279 | usb_unlink_urb(this_urb); |
283 | continue; | 280 | continue; |
284 | } | 281 | } |
@@ -293,7 +290,6 @@ static int option_write(struct usb_serial_port *port, | |||
293 | memcpy (this_urb->transfer_buffer, buf, todo); | 290 | memcpy (this_urb->transfer_buffer, buf, todo); |
294 | this_urb->transfer_buffer_length = todo; | 291 | this_urb->transfer_buffer_length = todo; |
295 | 292 | ||
296 | this_urb->transfer_flags &= ~URB_ASYNC_UNLINK; | ||
297 | this_urb->dev = port->serial->dev; | 293 | this_urb->dev = port->serial->dev; |
298 | err = usb_submit_urb(this_urb, GFP_ATOMIC); | 294 | err = usb_submit_urb(this_urb, GFP_ATOMIC); |
299 | if (err) { | 295 | if (err) { |
@@ -513,10 +509,8 @@ static int option_open(struct usb_serial_port *port, struct file *filp) | |||
513 | 509 | ||
514 | static inline void stop_urb(struct urb *urb) | 510 | static inline void stop_urb(struct urb *urb) |
515 | { | 511 | { |
516 | if (urb && urb->status == -EINPROGRESS) { | 512 | if (urb && urb->status == -EINPROGRESS) |
517 | urb->transfer_flags &= ~URB_ASYNC_UNLINK; | ||
518 | usb_kill_urb(urb); | 513 | usb_kill_urb(urb); |
519 | } | ||
520 | } | 514 | } |
521 | 515 | ||
522 | static void option_close(struct usb_serial_port *port, struct file *filp) | 516 | static void option_close(struct usb_serial_port *port, struct file *filp) |