[PATCH 08/10] USB: ftdi_sio: use generic chars_in_buffer

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Use generic chars_in_buffer rather than copying it's implementation.

Signed-off-by: Johan Hovold <jhovold@xxxxxxxxx>
---
 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 06b5d75..9fe3a2e 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) {
-- 
1.7.12.4

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux