X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=drivers%2Fserial%2Fdz.c;fp=drivers%2Fserial%2Fdz.c;h=ba5541de673b1706079fc28e5423612e556f8006;hb=64ba3f394c830ec48a1c31b53dcae312c56f1604;hp=8a98aae80e228ffd8afc2c57b868b8394aa7d765;hpb=be1e6109ac94a859551f8e1774eb9a8469fe055c;p=linux-2.6.git diff --git a/drivers/serial/dz.c b/drivers/serial/dz.c index 8a98aae80..ba5541de6 100644 --- a/drivers/serial/dz.c +++ b/drivers/serial/dz.c @@ -26,6 +26,7 @@ #undef DEBUG_DZ +#include #include #include #include @@ -673,12 +674,11 @@ static void dz_reset(struct dz_port *dport) } #ifdef CONFIG_SERIAL_DZ_CONSOLE -static void dz_console_putchar(struct uart_port *uport, int ch) +static void dz_console_put_char(struct dz_port *dport, unsigned char ch) { - struct dz_port *dport = (struct dz_port *)uport; unsigned long flags; int loops = 2500; - unsigned short tmp = (unsigned char)ch; + unsigned short tmp = ch; /* this code sends stuff out to serial device - spinning its wheels and waiting. */ @@ -694,7 +694,6 @@ static void dz_console_putchar(struct uart_port *uport, int ch) spin_unlock_irqrestore(&dport->port.lock, flags); } - /* * ------------------------------------------------------------------- * dz_console_print () @@ -711,7 +710,11 @@ static void dz_console_print(struct console *cons, #ifdef DEBUG_DZ prom_printf((char *) str); #endif - uart_console_write(&dport->port, str, count, dz_console_putchar); + while (count--) { + if (*str == '\n') + dz_console_put_char(dport, '\r'); + dz_console_put_char(dport, *str++); + } } static int __init dz_console_setup(struct console *co, char *options) @@ -767,7 +770,11 @@ void __init dz_serial_console_init(void) static struct uart_driver dz_reg = { .owner = THIS_MODULE, .driver_name = "serial", +#ifdef CONFIG_DEVFS + .dev_name = "tts/%d", +#else .dev_name = "ttyS%d", +#endif .major = TTY_MAJOR, .minor = 64, .nr = DZ_NB_PORT, @@ -797,7 +804,7 @@ int __init dz_init(void) restore_flags(flags); if (request_irq(dz_ports[0].port.irq, dz_interrupt, - IRQF_DISABLED, "DZ", &dz_ports[0])) + SA_INTERRUPT, "DZ", &dz_ports[0])) panic("Unable to register DZ interrupt"); ret = uart_register_driver(&dz_reg);