From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752934AbaFXIZ5 (ORCPT ); Tue, 24 Jun 2014 04:25:57 -0400 Received: from smtprelay4.synopsys.com ([198.182.44.111]:53660 "EHLO smtprelay.synopsys.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752520AbaFXIZy (ORCPT ); Tue, 24 Jun 2014 04:25:54 -0400 From: Vineet Gupta To: Rob Herring , Pawel Moll , "Mark Rutland" , Ian Campbell , Kumar Gala , Greg Kroah-Hartman , Jiri Slaby , Paul Bolle CC: , , , , Vineet Gupta Subject: [PATCH v2 REBASED 01/10] serial/arc: use uart_console_write() helper Date: Tue, 24 Jun 2014 13:55:06 +0530 Message-ID: <1403598315-1429-2-git-send-email-vgupta@synopsys.com> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1403598315-1429-1-git-send-email-vgupta@synopsys.com> References: <1403598315-1429-1-git-send-email-vgupta@synopsys.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.12.196.93] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Signed-off-by: Vineet Gupta --- drivers/tty/serial/arc_uart.c | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/drivers/tty/serial/arc_uart.c b/drivers/tty/serial/arc_uart.c index c9f5c9dcc15c..32fb8b94ff7c 100644 --- a/drivers/tty/serial/arc_uart.c +++ b/drivers/tty/serial/arc_uart.c @@ -478,14 +478,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 @@ -622,11 +622,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 */ @@ -637,7 +632,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); } @@ -655,13 +650,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 = { -- 1.8.3.2 From mboxrd@z Thu Jan 1 00:00:00 1970 From: Vineet Gupta Subject: [PATCH v2 REBASED 01/10] serial/arc: use uart_console_write() helper Date: Tue, 24 Jun 2014 13:55:06 +0530 Message-ID: <1403598315-1429-2-git-send-email-vgupta@synopsys.com> References: <1403598315-1429-1-git-send-email-vgupta@synopsys.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: In-Reply-To: <1403598315-1429-1-git-send-email-vgupta@synopsys.com> Sender: linux-kernel-owner@vger.kernel.org To: Rob Herring , Pawel Moll , Mark Rutland , Ian Campbell , Kumar Gala , Greg Kroah-Hartman , Jiri Slaby , Paul Bolle Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, Francois.Bedard@synopsys.com, Vineet Gupta List-Id: devicetree@vger.kernel.org Signed-off-by: Vineet Gupta --- drivers/tty/serial/arc_uart.c | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/drivers/tty/serial/arc_uart.c b/drivers/tty/serial/arc_uart.c index c9f5c9dcc15c..32fb8b94ff7c 100644 --- a/drivers/tty/serial/arc_uart.c +++ b/drivers/tty/serial/arc_uart.c @@ -478,14 +478,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 @@ -622,11 +622,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 */ @@ -637,7 +632,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); } @@ -655,13 +650,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 = { -- 1.8.3.2