Skip to content

Commit

Permalink
USB: ftdi_sio: use generic chars_in_buffer
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Johan Hovold authored and Greg Kroah-Hartman committed Oct 30, 2012
1 parent 428d998 commit 755b604
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions drivers/usb/serial/ftdi_sio.c
Original file line number Diff line number Diff line change
Expand Up @@ -2093,16 +2093,11 @@ static int ftdi_chars_in_buffer(struct tty_struct *tty)
{
struct usb_serial_port *port = tty->driver_data;
struct ftdi_private *priv = usb_get_serial_port_data(port);
unsigned long flags;
int chars;
unsigned char *buf;
int ret;

/* Check software buffer (code from
* usb_serial_generic_chars_in_buffer()) */
spin_lock_irqsave(&port->lock, flags);
chars = kfifo_len(&port->write_fifo) + port->tx_bytes;
spin_unlock_irqrestore(&port->lock, flags);
chars = usb_serial_generic_chars_in_buffer(tty);

/* Check hardware buffer */
switch (priv->chip_type) {
Expand Down

0 comments on commit 755b604

Please sign in to comment.