From d358788f3f30113e49882187d794832905e42592 Mon Sep 17 00:00:00 2001 From: Russell King Date: Mon, 20 Mar 2006 20:00:09 +0000 Subject: [SERIAL] kernel console should send CRLF not LFCR Glen Turner reported that writing LFCR rather than the more traditional CRLF causes issues with some terminals. Since this aflicts many serial drivers, extract the common code to a library function (uart_console_write) and arrange for each driver to supply a "putchar" function. Signed-off-by: Russell King --- drivers/serial/vr41xx_siu.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'drivers/serial/vr41xx_siu.c') diff --git a/drivers/serial/vr41xx_siu.c b/drivers/serial/vr41xx_siu.c index d61494d185cd..3f88b8e81937 100644 --- a/drivers/serial/vr41xx_siu.c +++ b/drivers/serial/vr41xx_siu.c @@ -821,25 +821,23 @@ static void wait_for_xmitr(struct uart_port *port) } } +static void siu_console_putchar(struct uart_port *port, int ch) +{ + wait_for_xmitr(port); + siu_write(port, UART_TX, ch); +} + static void siu_console_write(struct console *con, const char *s, unsigned count) { struct uart_port *port; uint8_t ier; - unsigned i; port = &siu_uart_ports[con->index]; ier = siu_read(port, UART_IER); siu_write(port, UART_IER, 0); - for (i = 0; i < count && *s != '\0'; i++, s++) { - wait_for_xmitr(port); - siu_write(port, UART_TX, *s); - if (*s == '\n') { - wait_for_xmitr(port); - siu_write(port, UART_TX, '\r'); - } - } + uart_console_write(port, s, count, siu_console_putchar); wait_for_xmitr(port); siu_write(port, UART_IER, ier); -- cgit v1.2.3