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/sunzilog.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) (limited to 'drivers/serial/sunzilog.c') diff --git a/drivers/serial/sunzilog.c b/drivers/serial/sunzilog.c index 5cc4d4c2935c..b0c46b9a5930 100644 --- a/drivers/serial/sunzilog.c +++ b/drivers/serial/sunzilog.c @@ -1252,8 +1252,9 @@ static struct zilog_layout __iomem * __init get_zs(int chip, int node) #define ZS_PUT_CHAR_MAX_DELAY 2000 /* 10 ms */ -static void sunzilog_put_char(struct zilog_channel __iomem *channel, unsigned char ch) +static void sunzilog_putchar(struct uart_port *port, int ch) { + struct zilog_channel *channel = ZILOG_CHANNEL_FROM_PORT(port); int loops = ZS_PUT_CHAR_MAX_DELAY; /* This is a timed polling loop so do not switch the explicit @@ -1284,7 +1285,7 @@ static int sunzilog_serio_write(struct serio *serio, unsigned char ch) spin_lock_irqsave(&sunzilog_serio_lock, flags); - sunzilog_put_char(ZILOG_CHANNEL_FROM_PORT(&up->port), ch); + sunzilog_putchar(&up->port, ch); spin_unlock_irqrestore(&sunzilog_serio_lock, flags); @@ -1325,16 +1326,10 @@ static void sunzilog_console_write(struct console *con, const char *s, unsigned int count) { struct uart_sunzilog_port *up = &sunzilog_port_table[con->index]; - struct zilog_channel *channel = ZILOG_CHANNEL_FROM_PORT(&up->port); unsigned long flags; - int i; spin_lock_irqsave(&up->port.lock, flags); - for (i = 0; i < count; i++, s++) { - sunzilog_put_char(channel, *s); - if (*s == 10) - sunzilog_put_char(channel, 13); - } + uart_console_write(&up->port, s, count, sunzilog_putchar); udelay(2); spin_unlock_irqrestore(&up->port.lock, flags); } -- cgit v1.2.3-55-g7522