diff options
-rw-r--r-- | drivers/tty/serial/max310x.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/drivers/tty/serial/max310x.c b/drivers/tty/serial/max310x.c index 36943f6c198c..81b2413c3da4 100644 --- a/drivers/tty/serial/max310x.c +++ b/drivers/tty/serial/max310x.c | |||
@@ -680,10 +680,16 @@ static void max310x_handle_rx(struct uart_port *port, unsigned int rxlen) | |||
680 | port->icount.overrun++; | 680 | port->icount.overrun++; |
681 | } | 681 | } |
682 | 682 | ||
683 | for (i = 0; i < rxlen; ++i) { | 683 | for (i = 0; i < (rxlen - 1); ++i) |
684 | uart_insert_char(port, sts, MAX310X_LSR_RXOVR_BIT, | 684 | uart_insert_char(port, sts, 0, one->rx_buf[i], flag); |
685 | one->rx_buf[i], flag); | 685 | |
686 | } | 686 | /* |
687 | * Handle the overrun case for the last character only, since | ||
688 | * the RxFIFO overflow happens after it is pushed to the FIFO | ||
689 | * tail. | ||
690 | */ | ||
691 | uart_insert_char(port, sts, MAX310X_LSR_RXOVR_BIT, | ||
692 | one->rx_buf[rxlen], flag); | ||
687 | 693 | ||
688 | } else { | 694 | } else { |
689 | if (unlikely(rxlen >= port->fifosize)) { | 695 | if (unlikely(rxlen >= port->fifosize)) { |