diff options
author | Johan Hovold <johan@kernel.org> | 2014-11-18 05:25:20 -0500 |
---|---|---|
committer | Johan Hovold <johan@kernel.org> | 2014-11-19 10:22:22 -0500 |
commit | 855515a6d3731242d85850a206f2ec084c917338 (patch) | |
tree | 9617630f7eefa4c289fd7163774718d5bb08add4 /drivers/usb/serial/keyspan.c | |
parent | 5d1678a33c731b56e245e888fdae5e88efce0997 (diff) |
USB: keyspan: fix overrun-error reporting
Fix reporting of overrun errors, which are not associated with a
character. Instead insert a null character and report only once.
Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Johan Hovold <johan@kernel.org>
Diffstat (limited to 'drivers/usb/serial/keyspan.c')
-rw-r--r-- | drivers/usb/serial/keyspan.c | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/drivers/usb/serial/keyspan.c b/drivers/usb/serial/keyspan.c index 7799d8bc4a63..077c714f1285 100644 --- a/drivers/usb/serial/keyspan.c +++ b/drivers/usb/serial/keyspan.c | |||
@@ -311,12 +311,13 @@ static void usa26_indat_callback(struct urb *urb) | |||
311 | if ((data[0] & 0x80) == 0) { | 311 | if ((data[0] & 0x80) == 0) { |
312 | /* no errors on individual bytes, only | 312 | /* no errors on individual bytes, only |
313 | possible overrun err */ | 313 | possible overrun err */ |
314 | if (data[0] & RXERROR_OVERRUN) | 314 | if (data[0] & RXERROR_OVERRUN) { |
315 | err = TTY_OVERRUN; | 315 | tty_insert_flip_char(&port->port, 0, |
316 | else | 316 | TTY_OVERRUN); |
317 | err = 0; | 317 | } |
318 | for (i = 1; i < urb->actual_length ; ++i) | 318 | for (i = 1; i < urb->actual_length ; ++i) |
319 | tty_insert_flip_char(&port->port, data[i], err); | 319 | tty_insert_flip_char(&port->port, data[i], |
320 | TTY_NORMAL); | ||
320 | } else { | 321 | } else { |
321 | /* some bytes had errors, every byte has status */ | 322 | /* some bytes had errors, every byte has status */ |
322 | dev_dbg(&port->dev, "%s - RX error!!!!\n", __func__); | 323 | dev_dbg(&port->dev, "%s - RX error!!!!\n", __func__); |
@@ -787,13 +788,13 @@ static void usa90_indat_callback(struct urb *urb) | |||
787 | if ((data[0] & 0x80) == 0) { | 788 | if ((data[0] & 0x80) == 0) { |
788 | /* no errors on individual bytes, only | 789 | /* no errors on individual bytes, only |
789 | possible overrun err*/ | 790 | possible overrun err*/ |
790 | if (data[0] & RXERROR_OVERRUN) | 791 | if (data[0] & RXERROR_OVERRUN) { |
791 | err = TTY_OVERRUN; | 792 | tty_insert_flip_char(&port->port, 0, |
792 | else | 793 | TTY_OVERRUN); |
793 | err = 0; | 794 | } |
794 | for (i = 1; i < urb->actual_length ; ++i) | 795 | for (i = 1; i < urb->actual_length ; ++i) |
795 | tty_insert_flip_char(&port->port, | 796 | tty_insert_flip_char(&port->port, |
796 | data[i], err); | 797 | data[i], TTY_NORMAL); |
797 | } else { | 798 | } else { |
798 | /* some bytes had errors, every byte has status */ | 799 | /* some bytes had errors, every byte has status */ |
799 | dev_dbg(&port->dev, "%s - RX error!!!!\n", __func__); | 800 | dev_dbg(&port->dev, "%s - RX error!!!!\n", __func__); |