aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/serial/dz.c
diff options
context:
space:
mode:
authorRussell King <rmk@dyn-67.arm.linux.org.uk>2006-03-20 15:00:09 -0500
committerRussell King <rmk+kernel@arm.linux.org.uk>2006-03-20 15:00:09 -0500
commitd358788f3f30113e49882187d794832905e42592 (patch)
tree8c796ee4bf719dad4d3947c03cef2f3fd6cb5940 /drivers/serial/dz.c
parent7705a8792b0fc82fd7d4dd923724606bbfd9fb20 (diff)
[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 <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'drivers/serial/dz.c')
-rw-r--r--drivers/serial/dz.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/drivers/serial/dz.c b/drivers/serial/dz.c
index ba5541de673b..bf71bad5c34f 100644
--- a/drivers/serial/dz.c
+++ b/drivers/serial/dz.c
@@ -674,11 +674,12 @@ static void dz_reset(struct dz_port *dport)
674} 674}
675 675
676#ifdef CONFIG_SERIAL_DZ_CONSOLE 676#ifdef CONFIG_SERIAL_DZ_CONSOLE
677static void dz_console_put_char(struct dz_port *dport, unsigned char ch) 677static void dz_console_putchar(struct uart_port *port, int ch)
678{ 678{
679 struct dz_port *dport = (struct dz_port *)uport;
679 unsigned long flags; 680 unsigned long flags;
680 int loops = 2500; 681 int loops = 2500;
681 unsigned short tmp = ch; 682 unsigned short tmp = (unsigned char)ch;
682 /* this code sends stuff out to serial device - spinning its 683 /* this code sends stuff out to serial device - spinning its
683 wheels and waiting. */ 684 wheels and waiting. */
684 685
@@ -694,6 +695,7 @@ static void dz_console_put_char(struct dz_port *dport, unsigned char ch)
694 695
695 spin_unlock_irqrestore(&dport->port.lock, flags); 696 spin_unlock_irqrestore(&dport->port.lock, flags);
696} 697}
698
697/* 699/*
698 * ------------------------------------------------------------------- 700 * -------------------------------------------------------------------
699 * dz_console_print () 701 * dz_console_print ()
@@ -710,11 +712,7 @@ static void dz_console_print(struct console *cons,
710#ifdef DEBUG_DZ 712#ifdef DEBUG_DZ
711 prom_printf((char *) str); 713 prom_printf((char *) str);
712#endif 714#endif
713 while (count--) { 715 uart_console_write(&dport->port, str, count, dz_console_putchar);
714 if (*str == '\n')
715 dz_console_put_char(dport, '\r');
716 dz_console_put_char(dport, *str++);
717 }
718} 716}
719 717
720static int __init dz_console_setup(struct console *co, char *options) 718static int __init dz_console_setup(struct console *co, char *options)