serial/arc: use uart_console_write() helper
authorVineet Gupta <Vineet.Gupta1@synopsys.com>
Tue, 24 Jun 2014 08:25:06 +0000 (13:55 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 10 Jul 2014 22:43:27 +0000 (15:43 -0700)
Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/arc_uart.c

index 643658f2b5b26d21729eefe7e7e37ca5f857e986..b4859598e1576f770b319c6911300fed8d11ba37 100644 (file)
@@ -471,14 +471,14 @@ static void arc_serial_config_port(struct uart_port *port, int flags)
 
 #if defined(CONFIG_CONSOLE_POLL) || defined(CONFIG_SERIAL_ARC_CONSOLE)
 
-static void arc_serial_poll_putchar(struct uart_port *port, unsigned char chr)
+static void arc_serial_poll_putchar(struct uart_port *port, int chr)
 {
        struct arc_uart_port *uart = to_arc_port(port);
 
        while (!(UART_GET_STATUS(uart) & TXEMPTY))
                cpu_relax();
 
-       UART_SET_DATA(uart, chr);
+       UART_SET_DATA(uart, (unsigned char)chr);
 }
 #endif
 
@@ -614,11 +614,6 @@ static int arc_serial_console_setup(struct console *co, char *options)
        return uart_set_options(port, co, baud, parity, bits, flow);
 }
 
-static void arc_serial_console_putchar(struct uart_port *port, int ch)
-{
-       arc_serial_poll_putchar(port, (unsigned char)ch);
-}
-
 /*
  * Interrupts are disabled on entering
  */
@@ -629,7 +624,7 @@ static void arc_serial_console_write(struct console *co, const char *s,
        unsigned long flags;
 
        spin_lock_irqsave(&port->lock, flags);
-       uart_console_write(port, s, count, arc_serial_console_putchar);
+       uart_console_write(port, s, count, arc_serial_poll_putchar);
        spin_unlock_irqrestore(&port->lock, flags);
 }
 
@@ -647,13 +642,8 @@ static __init void early_serial_write(struct console *con, const char *s,
                                        unsigned int n)
 {
        struct uart_port *port = &arc_uart_ports[con->index].port;
-       unsigned int i;
 
-       for (i = 0; i < n; i++, s++) {
-               if (*s == '\n')
-                       arc_serial_poll_putchar(port, '\r');
-               arc_serial_poll_putchar(port, *s);
-       }
+       uart_console_write(port, s, n, arc_serial_poll_putchar);
 }
 
 static struct console arc_early_serial_console __initdata = {