diff options
author | Johan Hovold <jhovold@gmail.com> | 2011-11-06 13:06:24 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-11-15 13:33:12 -0500 |
commit | da280e3488660042a1659cb756ae6ab0bf6f8f5f (patch) | |
tree | 03f3bde6ff88c3a5969bf11e29f397d47e82169a /drivers/usb/serial | |
parent | c1cac10c175f4b01b6722d246d80dd6c9975f0c1 (diff) |
USB: keyspan_pda: clean up write-urb busy handling
Use port write_urbs_free mask rather than write_urb_busy field in struct
serial_port.
Compile-only tested.
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/serial')
-rw-r--r-- | drivers/usb/serial/keyspan_pda.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/usb/serial/keyspan_pda.c b/drivers/usb/serial/keyspan_pda.c index fde553785d2b..9428cc0cfb12 100644 --- a/drivers/usb/serial/keyspan_pda.c +++ b/drivers/usb/serial/keyspan_pda.c | |||
@@ -479,11 +479,11 @@ static int keyspan_pda_write(struct tty_struct *tty, | |||
479 | the device is full (wait until it says there is room) | 479 | the device is full (wait until it says there is room) |
480 | */ | 480 | */ |
481 | spin_lock_bh(&port->lock); | 481 | spin_lock_bh(&port->lock); |
482 | if (port->write_urb_busy || priv->tx_throttled) { | 482 | if (!test_bit(0, &port->write_urbs_free) || priv->tx_throttled) { |
483 | spin_unlock_bh(&port->lock); | 483 | spin_unlock_bh(&port->lock); |
484 | return 0; | 484 | return 0; |
485 | } | 485 | } |
486 | port->write_urb_busy = 1; | 486 | clear_bit(0, &port->write_urbs_free); |
487 | spin_unlock_bh(&port->lock); | 487 | spin_unlock_bh(&port->lock); |
488 | 488 | ||
489 | /* At this point the URB is in our control, nobody else can submit it | 489 | /* At this point the URB is in our control, nobody else can submit it |
@@ -565,7 +565,7 @@ static int keyspan_pda_write(struct tty_struct *tty, | |||
565 | rc = count; | 565 | rc = count; |
566 | exit: | 566 | exit: |
567 | if (rc < 0) | 567 | if (rc < 0) |
568 | port->write_urb_busy = 0; | 568 | set_bit(0, &port->write_urbs_free); |
569 | return rc; | 569 | return rc; |
570 | } | 570 | } |
571 | 571 | ||
@@ -575,7 +575,7 @@ static void keyspan_pda_write_bulk_callback(struct urb *urb) | |||
575 | struct usb_serial_port *port = urb->context; | 575 | struct usb_serial_port *port = urb->context; |
576 | struct keyspan_pda_private *priv; | 576 | struct keyspan_pda_private *priv; |
577 | 577 | ||
578 | port->write_urb_busy = 0; | 578 | set_bit(0, &port->write_urbs_free); |
579 | priv = usb_get_serial_port_data(port); | 579 | priv = usb_get_serial_port_data(port); |
580 | 580 | ||
581 | /* queue up a wakeup at scheduler time */ | 581 | /* queue up a wakeup at scheduler time */ |
@@ -608,7 +608,7 @@ static int keyspan_pda_chars_in_buffer(struct tty_struct *tty) | |||
608 | n_tty.c:normal_poll() ) that we're not writeable. */ | 608 | n_tty.c:normal_poll() ) that we're not writeable. */ |
609 | 609 | ||
610 | spin_lock_irqsave(&port->lock, flags); | 610 | spin_lock_irqsave(&port->lock, flags); |
611 | if (port->write_urb_busy || priv->tx_throttled) | 611 | if (!test_bit(0, &port->write_urbs_free) || priv->tx_throttled) |
612 | ret = 256; | 612 | ret = 256; |
613 | spin_unlock_irqrestore(&port->lock, flags); | 613 | spin_unlock_irqrestore(&port->lock, flags); |
614 | return ret; | 614 | return ret; |