From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Thompson Subject: Re: [PATCH] serial: altera_jtaguart: Adpot uart_console_write() Date: Tue, 15 Jul 2014 16:52:45 +0100 Message-ID: <53C54E4D.70904@linaro.org> References: <1405438008-27020-1-git-send-email-tklauser@distanz.ch> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Return-path: Received: from mail-wi0-f171.google.com ([209.85.212.171]:59539 "EHLO mail-wi0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752103AbaGOPxD (ORCPT ); Tue, 15 Jul 2014 11:53:03 -0400 Received: by mail-wi0-f171.google.com with SMTP id hi2so4651521wib.4 for ; Tue, 15 Jul 2014 08:53:01 -0700 (PDT) In-Reply-To: <1405438008-27020-1-git-send-email-tklauser@distanz.ch> Sender: linux-serial-owner@vger.kernel.org List-Id: linux-serial@vger.kernel.org To: Tobias Klauser , Greg Kroah-Hartman Cc: Jiri Slaby , linux-serial@vger.kernel.org, nios2-dev@lists.rocketboards.org On 15/07/14 16:26, Tobias Klauser wrote: > Follow commit 2970b7f5ea3c ("serial: altera: Adopt > uart_console_write()") and don't open code the LF to LFCR conversion in > altera_jtaguart either. Use uart_console_write() instead. Cool. I just wish I'd remembered to check the other altera drivers myself. Reviewed-by: Daniel Thompson > Cc: Daniel Thompson > Signed-off-by: Tobias Klauser > --- > drivers/tty/serial/altera_jtaguart.c | 12 +++++------- > 1 file changed, 5 insertions(+), 7 deletions(-) > > diff --git a/drivers/tty/serial/altera_jtaguart.c b/drivers/tty/serial/altera_jtaguart.c > index e7d1aaf..afe2e75 100644 > --- a/drivers/tty/serial/altera_jtaguart.c > +++ b/drivers/tty/serial/altera_jtaguart.c > @@ -304,7 +304,7 @@ static struct altera_jtaguart altera_jtaguart_ports[ALTERA_JTAGUART_MAXPORTS]; > #if defined(CONFIG_SERIAL_ALTERA_JTAGUART_CONSOLE) > > #if defined(CONFIG_SERIAL_ALTERA_JTAGUART_CONSOLE_BYPASS) > -static void altera_jtaguart_console_putc(struct console *co, const char c) > +static void altera_jtaguart_console_putc(struct console *co, int c) > { > struct uart_port *port = &(altera_jtaguart_ports + co->index)->port; > unsigned long status; > @@ -325,7 +325,7 @@ static void altera_jtaguart_console_putc(struct console *co, const char c) > spin_unlock_irqrestore(&port->lock, flags); > } > #else > -static void altera_jtaguart_console_putc(struct console *co, const char c) > +static void altera_jtaguart_console_putc(struct console *co, int c) > { > struct uart_port *port = &(altera_jtaguart_ports + co->index)->port; > unsigned long flags; > @@ -345,11 +345,9 @@ static void altera_jtaguart_console_putc(struct console *co, const char c) > static void altera_jtaguart_console_write(struct console *co, const char *s, > unsigned int count) > { > - for (; count; count--, s++) { > - altera_jtaguart_console_putc(co, *s); > - if (*s == '\n') > - altera_jtaguart_console_putc(co, '\r'); > - } > + struct uart_port *port = &(altera_jtaguart_ports + co->index)->port; > + > + uart_console_write(port, s, count, altera_jtaguart_console_putc); > } > > static int __init altera_jtaguart_console_setup(struct console *co, >