qlge: bugfix: Move netif_napi_del() to common call point.
[safe/jmp/linux-2.6] / drivers / serial / netx-serial.c
index 7502109..3e5dda8 100644 (file)
 
 #include <asm/io.h>
 #include <asm/irq.h>
-#include <asm/hardware.h>
-#include <asm/arch/netx-regs.h>
+#include <mach/hardware.h>
+#include <mach/netx-regs.h>
 
 /* We've been assigned a range on the "Low-density serial ports" major */
 #define SERIAL_NX_MAJOR        204
 #define MINOR_START    170
 
-#ifdef CONFIG_SERIAL_NETX_CONSOLE
-
 enum uart_regs {
        UART_DR              = 0x00,
        UART_SR              = 0x04,
@@ -200,10 +198,10 @@ static void netx_txint(struct uart_port *port)
                uart_write_wakeup(port);
 }
 
-static void netx_rxint(struct uart_port *port, struct pt_regs *regs)
+static void netx_rxint(struct uart_port *port)
 {
        unsigned char rx, flg, status;
-       struct tty_struct *tty = port->info->tty;
+       struct tty_struct *tty = port->info->port.tty;
 
        while (!(readl(port->membase + UART_FR) & FR_RXFE)) {
                rx = readl(port->membase + UART_DR);
@@ -235,7 +233,7 @@ static void netx_rxint(struct uart_port *port, struct pt_regs *regs)
                                flg = TTY_FRAME;
                }
 
-               if (uart_handle_sysrq_char(port, rx, regs))
+               if (uart_handle_sysrq_char(port, rx))
                        continue;
 
                uart_insert_char(port, status, SR_OE, rx, flg);
@@ -245,9 +243,9 @@ static void netx_rxint(struct uart_port *port, struct pt_regs *regs)
        return;
 }
 
-static irqreturn_t netx_int(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t netx_int(int irq, void *dev_id)
 {
-       struct uart_port *port = (struct uart_port *)dev_id;
+       struct uart_port *port = dev_id;
        unsigned long flags;
        unsigned char status;
 
@@ -256,7 +254,7 @@ static irqreturn_t netx_int(int irq, void *dev_id, struct pt_regs *regs)
        status = readl(port->membase + UART_IIR) & IIR_MASK;
        while (status) {
                if (status & IIR_RIS)
-                       netx_rxint(port, regs);
+                       netx_rxint(port);
                if (status & IIR_TIS)
                        netx_txint(port);
                if (status & IIR_MIS) {
@@ -287,6 +285,7 @@ static void netx_set_mctrl(struct uart_port *port, unsigned int mctrl)
 {
        unsigned int val;
 
+       /* FIXME: Locking needed ? */
        if (mctrl & TIOCM_RTS) {
                val = readl(port->membase + UART_RTS_CR);
                writel(val | RTS_CR_RTS, port->membase + UART_RTS_CR);
@@ -337,8 +336,8 @@ static void netx_shutdown(struct uart_port *port)
 }
 
 static void
-netx_set_termios(struct uart_port *port, struct termios *termios,
-                  struct termios *old)
+netx_set_termios(struct uart_port *port, struct ktermios *termios,
+                  struct ktermios *old)
 {
        unsigned int baud, quot;
        unsigned char old_cr;
@@ -527,6 +526,8 @@ static struct netx_port netx_ports[] = {
        }
 };
 
+#ifdef CONFIG_SERIAL_NETX_CONSOLE
+
 static void netx_console_putchar(struct uart_port *port, int ch)
 {
        while (readl(port->membase + UART_FR) & FR_BUSY);
@@ -713,6 +714,7 @@ static struct platform_driver serial_netx_driver = {
 
        .driver         = {
                .name   = DRIVER_NAME,
+               .owner  = THIS_MODULE,
        },
 };
 
@@ -745,3 +747,4 @@ module_exit(netx_serial_exit);
 MODULE_AUTHOR("Sascha Hauer");
 MODULE_DESCRIPTION("NetX serial port driver");
 MODULE_LICENSE("GPL");
+MODULE_ALIAS("platform:" DRIVER_NAME);