diff options
author | Johan Hovold <jhovold@gmail.com> | 2013-05-05 14:32:33 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-05-16 20:32:23 -0400 |
commit | 4746b6c6efcdc3f5ef84f0bc2c39707c6b4e5e24 (patch) | |
tree | 862e2c02f5933405a8f12f49840b153d76f89b68 | |
parent | ff93b19eed0d5c124ee7168650a8e2e120ac8ea4 (diff) |
USB: serial: clean up chars_in_buffer
No need to grab disconnect mutex in chars_in_buffer now that no
sub-driver is or should be querying hardware buffers anymore. (They
should use wait_until_sent.)
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/usb/serial/usb-serial.c | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/drivers/usb/serial/usb-serial.c b/drivers/usb/serial/usb-serial.c index 60caf9cb99f4..4753c005cfb6 100644 --- a/drivers/usb/serial/usb-serial.c +++ b/drivers/usb/serial/usb-serial.c | |||
@@ -359,20 +359,13 @@ static int serial_chars_in_buffer(struct tty_struct *tty) | |||
359 | { | 359 | { |
360 | struct usb_serial_port *port = tty->driver_data; | 360 | struct usb_serial_port *port = tty->driver_data; |
361 | struct usb_serial *serial = port->serial; | 361 | struct usb_serial *serial = port->serial; |
362 | int count = 0; | ||
363 | 362 | ||
364 | dev_dbg(tty->dev, "%s\n", __func__); | 363 | dev_dbg(tty->dev, "%s\n", __func__); |
365 | 364 | ||
366 | mutex_lock(&serial->disc_mutex); | ||
367 | /* if the device was unplugged then any remaining characters | ||
368 | fell out of the connector ;) */ | ||
369 | if (serial->disconnected) | 365 | if (serial->disconnected) |
370 | count = 0; | 366 | return 0; |
371 | else | ||
372 | count = serial->type->chars_in_buffer(tty); | ||
373 | mutex_unlock(&serial->disc_mutex); | ||
374 | 367 | ||
375 | return count; | 368 | return serial->type->chars_in_buffer(tty); |
376 | } | 369 | } |
377 | 370 | ||
378 | static void serial_wait_until_sent(struct tty_struct *tty, int timeout) | 371 | static void serial_wait_until_sent(struct tty_struct *tty, int timeout) |