aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVineet Gupta <Vineet.Gupta1@synopsys.com>2014-06-24 04:25:06 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-07-10 18:43:27 -0400
commit3bce1b70d6f2cdb83c9323c553b2336974b8516f (patch)
tree1c02594d948d6ee6347a25f67c08091a95c0553c
parent7d78cbefaa465bbf36e2b4b90d3c196a00f54008 (diff)
serial/arc: use uart_console_write() helper
Signed-off-by: Vineet Gupta <vgupta@synopsys.com> Reviewed-by: Rob Herring <robh@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/tty/serial/arc_uart.c18
1 files changed, 4 insertions, 14 deletions
diff --git a/drivers/tty/serial/arc_uart.c b/drivers/tty/serial/arc_uart.c
index 643658f2b5b2..b4859598e157 100644
--- a/drivers/tty/serial/arc_uart.c
+++ b/drivers/tty/serial/arc_uart.c
@@ -471,14 +471,14 @@ static void arc_serial_config_port(struct uart_port *port, int flags)
471 471
472#if defined(CONFIG_CONSOLE_POLL) || defined(CONFIG_SERIAL_ARC_CONSOLE) 472#if defined(CONFIG_CONSOLE_POLL) || defined(CONFIG_SERIAL_ARC_CONSOLE)
473 473
474static void arc_serial_poll_putchar(struct uart_port *port, unsigned char chr) 474static void arc_serial_poll_putchar(struct uart_port *port, int chr)
475{ 475{
476 struct arc_uart_port *uart = to_arc_port(port); 476 struct arc_uart_port *uart = to_arc_port(port);
477 477
478 while (!(UART_GET_STATUS(uart) & TXEMPTY)) 478 while (!(UART_GET_STATUS(uart) & TXEMPTY))
479 cpu_relax(); 479 cpu_relax();
480 480
481 UART_SET_DATA(uart, chr); 481 UART_SET_DATA(uart, (unsigned char)chr);
482} 482}
483#endif 483#endif
484 484
@@ -614,11 +614,6 @@ static int arc_serial_console_setup(struct console *co, char *options)
614 return uart_set_options(port, co, baud, parity, bits, flow); 614 return uart_set_options(port, co, baud, parity, bits, flow);
615} 615}
616 616
617static void arc_serial_console_putchar(struct uart_port *port, int ch)
618{
619 arc_serial_poll_putchar(port, (unsigned char)ch);
620}
621
622/* 617/*
623 * Interrupts are disabled on entering 618 * Interrupts are disabled on entering
624 */ 619 */
@@ -629,7 +624,7 @@ static void arc_serial_console_write(struct console *co, const char *s,
629 unsigned long flags; 624 unsigned long flags;
630 625
631 spin_lock_irqsave(&port->lock, flags); 626 spin_lock_irqsave(&port->lock, flags);
632 uart_console_write(port, s, count, arc_serial_console_putchar); 627 uart_console_write(port, s, count, arc_serial_poll_putchar);
633 spin_unlock_irqrestore(&port->lock, flags); 628 spin_unlock_irqrestore(&port->lock, flags);
634} 629}
635 630
@@ -647,13 +642,8 @@ static __init void early_serial_write(struct console *con, const char *s,
647 unsigned int n) 642 unsigned int n)
648{ 643{
649 struct uart_port *port = &arc_uart_ports[con->index].port; 644 struct uart_port *port = &arc_uart_ports[con->index].port;
650 unsigned int i;
651 645
652 for (i = 0; i < n; i++, s++) { 646 uart_console_write(port, s, n, arc_serial_poll_putchar);
653 if (*s == '\n')
654 arc_serial_poll_putchar(port, '\r');
655 arc_serial_poll_putchar(port, *s);
656 }
657} 647}
658 648
659static struct console arc_early_serial_console __initdata = { 649static struct console arc_early_serial_console __initdata = {