diff options
author | Johan Hovold <jhovold@gmail.com> | 2012-10-29 05:56:27 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-10-30 16:19:32 -0400 |
commit | 8da636d9b5f3af354458f5b7eadaf51f23017fdc (patch) | |
tree | 719a1aab1ca30ca0b3430dd6bfb5afcb0a1b4473 /drivers/usb/serial | |
parent | 755b6040fa62eab9d9105359cd5884910eef2df4 (diff) |
USB: ftdi_sio: optimise chars_in_buffer
No need to check hardware buffers when we know that the software
buffers are non-empty.
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/serial')
-rw-r--r-- | drivers/usb/serial/ftdi_sio.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c index 9fe3a2e965ad..b8bc9d0cb127 100644 --- a/drivers/usb/serial/ftdi_sio.c +++ b/drivers/usb/serial/ftdi_sio.c | |||
@@ -2098,6 +2098,8 @@ static int ftdi_chars_in_buffer(struct tty_struct *tty) | |||
2098 | int ret; | 2098 | int ret; |
2099 | 2099 | ||
2100 | chars = usb_serial_generic_chars_in_buffer(tty); | 2100 | chars = usb_serial_generic_chars_in_buffer(tty); |
2101 | if (chars) | ||
2102 | return chars; | ||
2101 | 2103 | ||
2102 | /* Check hardware buffer */ | 2104 | /* Check hardware buffer */ |
2103 | switch (priv->chip_type) { | 2105 | switch (priv->chip_type) { |