diff options
author | Johan Hovold <jhovold@gmail.com> | 2012-10-29 05:56:26 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-10-30 16:19:32 -0400 |
commit | 755b6040fa62eab9d9105359cd5884910eef2df4 (patch) | |
tree | 5c2e9dab8120c301516b663d1fae5101b19d71b4 /drivers/usb/serial/ftdi_sio.c | |
parent | 428d9988557f0f26047af304cf1f3d130b06ed4d (diff) |
USB: ftdi_sio: use generic chars_in_buffer
Use generic chars_in_buffer rather than copying it's implementation.
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/serial/ftdi_sio.c')
-rw-r--r-- | drivers/usb/serial/ftdi_sio.c | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c index 06b5d75dffc6..9fe3a2e965ad 100644 --- a/drivers/usb/serial/ftdi_sio.c +++ b/drivers/usb/serial/ftdi_sio.c | |||
@@ -2093,16 +2093,11 @@ static int ftdi_chars_in_buffer(struct tty_struct *tty) | |||
2093 | { | 2093 | { |
2094 | struct usb_serial_port *port = tty->driver_data; | 2094 | struct usb_serial_port *port = tty->driver_data; |
2095 | struct ftdi_private *priv = usb_get_serial_port_data(port); | 2095 | struct ftdi_private *priv = usb_get_serial_port_data(port); |
2096 | unsigned long flags; | ||
2097 | int chars; | 2096 | int chars; |
2098 | unsigned char *buf; | 2097 | unsigned char *buf; |
2099 | int ret; | 2098 | int ret; |
2100 | 2099 | ||
2101 | /* Check software buffer (code from | 2100 | chars = usb_serial_generic_chars_in_buffer(tty); |
2102 | * usb_serial_generic_chars_in_buffer()) */ | ||
2103 | spin_lock_irqsave(&port->lock, flags); | ||
2104 | chars = kfifo_len(&port->write_fifo) + port->tx_bytes; | ||
2105 | spin_unlock_irqrestore(&port->lock, flags); | ||
2106 | 2101 | ||
2107 | /* Check hardware buffer */ | 2102 | /* Check hardware buffer */ |
2108 | switch (priv->chip_type) { | 2103 | switch (priv->chip_type) { |