From 755b6040fa62eab9d9105359cd5884910eef2df4 Mon Sep 17 00:00:00 2001 From: Johan Hovold Date: Mon, 29 Oct 2012 10:56:26 +0100 Subject: [PATCH] USB: ftdi_sio: use generic chars_in_buffer Use generic chars_in_buffer rather than copying it's implementation. Signed-off-by: Johan Hovold Signed-off-by: Greg Kroah-Hartman --- drivers/usb/serial/ftdi_sio.c | 7 +------ 1 file changed, 1 insertion(+), 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) { 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) { -- 2.39.5