X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=drivers%2Fserial%2Fsa1100.c;fp=drivers%2Fserial%2Fsa1100.c;h=2c00b862585295474c56a32872a009d7a35c363a;hb=64ba3f394c830ec48a1c31b53dcae312c56f1604;hp=db3486d338707cd9d1e22e24d78bf3d9e80f4c2c;hpb=be1e6109ac94a859551f8e1774eb9a8469fe055c;p=linux-2.6.git diff --git a/drivers/serial/sa1100.c b/drivers/serial/sa1100.c index db3486d33..2c00b8625 100644 --- a/drivers/serial/sa1100.c +++ b/drivers/serial/sa1100.c @@ -24,6 +24,7 @@ * $Id: sa1100.c,v 1.50 2002/07/29 14:41:04 rmk Exp $ * */ +#include #if defined(CONFIG_SERIAL_SA1100_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ) #define SUPPORT_SYSRQ @@ -688,14 +689,6 @@ void __init sa1100_register_uart(int idx, int port) #ifdef CONFIG_SERIAL_SA1100_CONSOLE -static void sa1100_console_putchar(struct uart_port *port, int ch) -{ - struct sa1100_port *sport = (struct sa1100_port *)port; - - while (!(UART_GET_UTSR1(sport) & UTSR1_TNF)) - barrier(); - UART_PUT_CHAR(sport, ch); -} /* * Interrupts are disabled on entering @@ -704,7 +697,7 @@ static void sa1100_console_write(struct console *co, const char *s, unsigned int count) { struct sa1100_port *sport = &sa1100_ports[co->index]; - unsigned int old_utcr3, status; + unsigned int old_utcr3, status, i; /* * First, save UTCR3 and then disable interrupts @@ -713,7 +706,21 @@ sa1100_console_write(struct console *co, const char *s, unsigned int count) UART_PUT_UTCR3(sport, (old_utcr3 & ~(UTCR3_RIE | UTCR3_TIE)) | UTCR3_TXE); - uart_console_write(&sport->port, s, count, sa1100_console_putchar); + /* + * Now, do each character + */ + for (i = 0; i < count; i++) { + do { + status = UART_GET_UTSR1(sport); + } while (!(status & UTSR1_TNF)); + UART_PUT_CHAR(sport, s[i]); + if (s[i] == '\n') { + do { + status = UART_GET_UTSR1(sport); + } while (!(status & UTSR1_TNF)); + UART_PUT_CHAR(sport, '\r'); + } + } /* * Finally, wait for transmitter to become empty @@ -815,6 +822,7 @@ static struct uart_driver sa1100_reg = { .owner = THIS_MODULE, .driver_name = "ttySA", .dev_name = "ttySA", + .devfs_name = "ttySA", .major = SERIAL_SA1100_MAJOR, .minor = MINOR_START, .nr = NR_PORTS,