Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 755b6040 authored by Johan Hovold's avatar Johan Hovold Committed by Greg Kroah-Hartman
Browse files

USB: ftdi_sio: use generic chars_in_buffer



Use generic chars_in_buffer rather than copying it's implementation.

Signed-off-by: default avatarJohan Hovold <jhovold@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 428d9988
Loading
Loading
Loading
Loading
+1 −6
Original line number Original line Diff line number Diff line
@@ -2093,16 +2093,11 @@ static int ftdi_chars_in_buffer(struct tty_struct *tty)
{
{
	struct usb_serial_port *port = tty->driver_data;
	struct usb_serial_port *port = tty->driver_data;
	struct ftdi_private *priv = usb_get_serial_port_data(port);
	struct ftdi_private *priv = usb_get_serial_port_data(port);
	unsigned long flags;
	int chars;
	int chars;
	unsigned char *buf;
	unsigned char *buf;
	int ret;
	int ret;


	/* Check software buffer (code from
	chars = usb_serial_generic_chars_in_buffer(tty);
	 * 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);


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