X-Git-Url: http://pileus.org/git/?a=blobdiff_plain;f=drivers%2Fserial%2Fclps711x.c;h=d822896b488c80c45f68738f237a000e5af76b50;hb=5d54e69c68c05b162a56f9914cae72afd7e6f40a;hp=e145e19b3fb528141f02a774ee1db5ddbeccd0d7;hpb=45849282bfd7543253761cbf7db96151b05e5ed1;p=~andy%2Flinux diff --git a/drivers/serial/clps711x.c b/drivers/serial/clps711x.c index e145e19b3fb..d822896b488 100644 --- a/drivers/serial/clps711x.c +++ b/drivers/serial/clps711x.c @@ -69,8 +69,7 @@ #define tx_enabled(port) ((port)->unused[0]) -static void -clps711xuart_stop_tx(struct uart_port *port, unsigned int tty_stop) +static void clps711xuart_stop_tx(struct uart_port *port) { if (tx_enabled(port)) { disable_irq(TX_IRQ(port)); @@ -78,8 +77,7 @@ clps711xuart_stop_tx(struct uart_port *port, unsigned int tty_stop) } } -static void -clps711xuart_start_tx(struct uart_port *port, unsigned int tty_start) +static void clps711xuart_start_tx(struct uart_port *port) { if (!tx_enabled(port)) { enable_irq(TX_IRQ(port)); @@ -116,54 +114,40 @@ static irqreturn_t clps711xuart_int_rx(int irq, void *dev_id, struct pt_regs *re * Note that the error handling code is * out of the main execution path */ - if (unlikely(ch & UART_ANY_ERR)) - goto handle_error; + if (unlikely(ch & UART_ANY_ERR)) { + if (ch & UARTDR_PARERR) + port->icount.parity++; + else if (ch & UARTDR_FRMERR) + port->icount.frame++; + if (ch & UARTDR_OVERR) + port->icount.overrun++; - if (uart_handle_sysrq_char(port, ch, regs)) - goto ignore_char; + ch &= port->read_status_mask; - error_return: - tty_insert_flip_char(tty, ch, flg); - ignore_char: - status = clps_readl(SYSFLG(port)); - } - out: - tty_flip_buffer_push(tty); - return IRQ_HANDLED; + if (ch & UARTDR_PARERR) + flg = TTY_PARITY; + else if (ch & UARTDR_FRMERR) + flg = TTY_FRAME; - handle_error: - if (ch & UARTDR_PARERR) - port->icount.parity++; - else if (ch & UARTDR_FRMERR) - port->icount.frame++; - if (ch & UARTDR_OVERR) - port->icount.overrun++; - - if (ch & port->ignore_status_mask) { - if (++ignored > 100) - goto out; - goto ignore_char; - } - ch &= port->read_status_mask; +#ifdef SUPPORT_SYSRQ + port->sysrq = 0; +#endif + } - if (ch & UARTDR_PARERR) - flg = TTY_PARITY; - else if (ch & UARTDR_FRMERR) - flg = TTY_FRAME; + if (uart_handle_sysrq_char(port, ch, regs)) + goto ignore_char; - if (ch & UARTDR_OVERR) { /* * CHECK: does overrun affect the current character? * ASSUMPTION: it does not. */ - tty_insert_flip_char(tty, ch, flg); - ch = 0; - flg = TTY_OVERRUN; + uart_insert_char(port, ch, UARTDR_OVERR, ch, flg); + + ignore_char: + status = clps_readl(SYSFLG(port)); } -#ifdef SUPPORT_SYSRQ - port->sysrq = 0; -#endif - goto error_return; + tty_flip_buffer_push(tty); + return IRQ_HANDLED; } static irqreturn_t clps711xuart_int_tx(int irq, void *dev_id, struct pt_regs *regs) @@ -179,7 +163,7 @@ static irqreturn_t clps711xuart_int_tx(int irq, void *dev_id, struct pt_regs *re return IRQ_HANDLED; } if (uart_circ_empty(xmit) || uart_tx_stopped(port)) { - clps711xuart_stop_tx(port, 0); + clps711xuart_stop_tx(port); return IRQ_HANDLED; } @@ -196,7 +180,7 @@ static irqreturn_t clps711xuart_int_tx(int irq, void *dev_id, struct pt_regs *re uart_write_wakeup(port); if (uart_circ_empty(xmit)) - clps711xuart_stop_tx(port, 0); + clps711xuart_stop_tx(port); return IRQ_HANDLED; }