Merge branch 'master' into upstream
[powerpc.git] / drivers / serial / at91_serial.c
index 0e20606..6547fe0 100644 (file)
@@ -222,8 +222,6 @@ static void at91_rx_chars(struct uart_port *port, struct pt_regs *regs)
        while (status & (AT91_US_RXRDY)) {
                ch = UART_GET_CHAR(port);
 
-               if (tty->flip.count >= TTY_FLIPBUF_SIZE)
-                       goto ignore_char;
                port->icount.rx++;
 
                flg = TTY_NORMAL;
@@ -713,6 +711,12 @@ void __init at91_register_uart(int idx, int port)
 }
 
 #ifdef CONFIG_SERIAL_AT91_CONSOLE
+static void at91_console_putchar(struct uart_port *port, int ch)
+{
+       while (!(UART_GET_CSR(port) & AT91_US_TXRDY))
+               barrier();
+       UART_PUT_CHAR(port, ch);
+}
 
 /*
  * Interrupts are disabled on entering
@@ -720,7 +724,7 @@ void __init at91_register_uart(int idx, int port)
 static void at91_console_write(struct console *co, const char *s, u_int count)
 {
        struct uart_port *port = at91_ports + co->index;
-       unsigned int status, i, imr;
+       unsigned int status, imr;
 
        /*
         *      First, save IMR and then disable interrupts
@@ -728,21 +732,7 @@ static void at91_console_write(struct console *co, const char *s, u_int count)
        imr = UART_GET_IMR(port);       /* get interrupt mask */
        UART_PUT_IDR(port, AT91_US_RXRDY | AT91_US_TXRDY);
 
-       /*
-        *      Now, do each character
-        */
-       for (i = 0; i < count; i++) {
-               do {
-                       status = UART_GET_CSR(port);
-               } while (!(status & AT91_US_TXRDY));
-               UART_PUT_CHAR(port, s[i]);
-               if (s[i] == '\n') {
-                       do {
-                               status = UART_GET_CSR(port);
-                       } while (!(status & AT91_US_TXRDY));
-                       UART_PUT_CHAR(port, '\r');
-               }
-       }
+       uart_console_write(port, s, count, at91_console_putchar);
 
        /*
         *      Finally, wait for transmitter to become empty