From: Vineet Gupta Date: Fri, 11 Jul 2014 13:01:37 +0000 (+0530) Subject: serial/arc: Fix warning with CONSOLE_POLL X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=f363ca2fc8d12ebaad1a8bdae0f164c17c747b89;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git serial/arc: Fix warning with CONSOLE_POLL | drivers/tty/serial/arc_uart.c:516:2: warning: (near initialization for 'arc_serial_pops.poll_put_char') [enabled by default] This partially undoes "serial/arc: use uart_console_write() helper" by restoring the prototpye of poll helper and use a different one in uart_console_write() Signed-off-by: Vineet Gupta Reported-by: kbuild test robot Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/tty/serial/arc_uart.c b/drivers/tty/serial/arc_uart.c index 3a504fb9c9e8..f8dc7d381956 100644 --- a/drivers/tty/serial/arc_uart.c +++ b/drivers/tty/serial/arc_uart.c @@ -442,18 +442,16 @@ static void arc_serial_config_port(struct uart_port *port, int flags) port->type = PORT_ARC; } -#if defined(CONFIG_CONSOLE_POLL) || defined(CONFIG_SERIAL_ARC_CONSOLE) +#ifdef CONFIG_CONSOLE_POLL -static void arc_serial_poll_putchar(struct uart_port *port, int chr) +static void arc_serial_poll_putchar(struct uart_port *port, unsigned char chr) { while (!(UART_GET_STATUS(port) & TXEMPTY)) cpu_relax(); - UART_SET_DATA(port, (unsigned char)chr); + UART_SET_DATA(port, chr); } -#endif -#ifdef CONFIG_CONSOLE_POLL static int arc_serial_poll_getchar(struct uart_port *port) { unsigned char chr; @@ -519,6 +517,14 @@ 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) +{ + while (!(UART_GET_STATUS(port) & TXEMPTY)) + cpu_relax(); + + UART_SET_DATA(port, (unsigned char)ch); +} + /* * Interrupts are disabled on entering */ @@ -529,7 +535,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_poll_putchar); + uart_console_write(port, s, count, arc_serial_console_putchar); spin_unlock_irqrestore(&port->lock, flags); } @@ -548,7 +554,7 @@ static __init void arc_early_serial_write(struct console *con, const char *s, { struct earlycon_device *dev = con->data; - uart_console_write(&dev->port, s, n, arc_serial_poll_putchar); + uart_console_write(&dev->port, s, n, arc_serial_console_putchar); } static int __init arc_early_console_setup(struct earlycon_device *dev,