X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=drivers%2Fserial%2Fsn_console.c;h=b73e3c0056cd77531248a89dc2925809e61faae6;hb=47c317a7aaa2fbac03811a569829fa954e641520;hp=709f93a6c18c6efb8715c1065dfb5f2fa85d590c;hpb=44aefd2706bb6f5b65ba2c38cd89e7609e2b43d3;p=linux-2.6 diff --git a/drivers/serial/sn_console.c b/drivers/serial/sn_console.c index 709f93a6c1..b73e3c0056 100644 --- a/drivers/serial/sn_console.c +++ b/drivers/serial/sn_console.c @@ -361,8 +361,8 @@ static int snp_startup(struct uart_port *port) * */ static void -snp_set_termios(struct uart_port *port, struct termios *termios, - struct termios *old) +snp_set_termios(struct uart_port *port, struct ktermios *termios, + struct ktermios *old) { } @@ -471,7 +471,7 @@ sn_receive_chars(struct sn_cons_port *port, unsigned long flags) if (port->sc_port.info) { /* The serial_core stuffs are initilized, use them */ - tty = port->sc_port.info->tty; + tty = port->sc_port.info->port.tty; } else { /* Not registered yet - can't pass to tty layer. */ @@ -635,25 +635,6 @@ static irqreturn_t sn_sal_interrupt(int irq, void *dev_id) return IRQ_HANDLED; } -/** - * sn_sal_connect_interrupt - Request interrupt, handled by sn_sal_interrupt - * @port: Our sn_cons_port (which contains the uart port) - * - * returns the console irq if interrupt is successfully registered, else 0 - * - */ -static int sn_sal_connect_interrupt(struct sn_cons_port *port) -{ - if (request_irq(SGI_UART_VECTOR, sn_sal_interrupt, - IRQF_DISABLED | IRQF_SHARED, - "SAL console driver", port) >= 0) { - return SGI_UART_VECTOR; - } - - printk(KERN_INFO "sn_console: console proceeding in polled mode\n"); - return 0; -} - /** * sn_sal_timer_poll - this function handles polled console mode * @data: A pointer to our sn_cons_port (which contains the uart port) @@ -674,7 +655,7 @@ static void sn_sal_timer_poll(unsigned long data) if (!port->sc_port.irq) { spin_lock_irqsave(&port->sc_port.lock, flags); if (sn_process_input) - sn_receive_chars(port, NULL, flags); + sn_receive_chars(port, flags); sn_transmit_chars(port, TRANSMIT_RAW); spin_unlock_irqrestore(&port->sc_port.lock, flags); mod_timer(&port->sc_timer, @@ -746,30 +727,31 @@ static void __init sn_sal_switch_to_asynch(struct sn_cons_port *port) * mode. We were previously in asynch/polling mode (using init_timer). * * We attempt to switch to interrupt mode here by calling - * sn_sal_connect_interrupt. If that works out, we enable receive interrupts. + * request_irq. If that works out, we enable receive interrupts. */ static void __init sn_sal_switch_to_interrupts(struct sn_cons_port *port) { - int irq; unsigned long flags; - if (!port) - return; - - DPRINTF("sn_console: switching to interrupt driven console\n"); - - spin_lock_irqsave(&port->sc_port.lock, flags); + if (port) { + DPRINTF("sn_console: switching to interrupt driven console\n"); - irq = sn_sal_connect_interrupt(port); + if (request_irq(SGI_UART_VECTOR, sn_sal_interrupt, + IRQF_DISABLED | IRQF_SHARED, + "SAL console driver", port) >= 0) { + spin_lock_irqsave(&port->sc_port.lock, flags); + port->sc_port.irq = SGI_UART_VECTOR; + port->sc_ops = &intr_ops; - if (irq) { - port->sc_port.irq = irq; - port->sc_ops = &intr_ops; - - /* turn on receive interrupts */ - ia64_sn_console_intr_enable(SAL_CONSOLE_INTR_RECV); + /* turn on receive interrupts */ + ia64_sn_console_intr_enable(SAL_CONSOLE_INTR_RECV); + spin_unlock_irqrestore(&port->sc_port.lock, flags); + } + else { + printk(KERN_INFO + "sn_console: console proceeding in polled mode\n"); + } } - spin_unlock_irqrestore(&port->sc_port.lock, flags); } /* @@ -777,7 +759,7 @@ static void __init sn_sal_switch_to_interrupts(struct sn_cons_port *port) */ static void sn_sal_console_write(struct console *, const char *, unsigned); -static int __init sn_sal_console_setup(struct console *, char *); +static int sn_sal_console_setup(struct console *, char *); static struct uart_driver sal_console_uart; extern struct tty_driver *uart_console_device(struct console *, int *); @@ -857,7 +839,7 @@ static int __init sn_sal_module_init(void) if (uart_add_one_port(&sal_console_uart, &sal_console_port.sc_port) < 0) { /* error - not sure what I'd do - so I'll do nothing */ - printk(KERN_ERR "%s: unable to add port\n", __FUNCTION__); + printk(KERN_ERR "%s: unable to add port\n", __func__); } /* when this driver is compiled in, the console initialization @@ -1024,7 +1006,7 @@ sn_sal_console_write(struct console *co, const char *s, unsigned count) * here so providing it is easier. * */ -static int __init sn_sal_console_setup(struct console *co, char *options) +static int sn_sal_console_setup(struct console *co, char *options) { return 0; }