qlge: bugfix: Move netif_napi_del() to common call point.
[safe/jmp/linux-2.6] / drivers / serial / 8250_gsc.c
index abc5a0c..418b4fe 100644 (file)
 #include <asm/hardware.h>
 #include <asm/parisc-device.h>
 #include <asm/io.h>
-#include <asm/serial.h> /* for LASI_BASE_BAUD */
 
 #include "8250.h"
 
-static int __init 
-serial_init_chip(struct parisc_device *dev)
+static int __init serial_init_chip(struct parisc_device *dev)
 {
-       static int serial_line_nr;
        struct uart_port port;
        unsigned long address;
        int err;
@@ -40,33 +37,36 @@ serial_init_chip(struct parisc_device *dev)
                 * what we have here is a missing parent device, so tell
                 * the user what they're missing.
                 */
-               if (parisc_parent(dev)->id.hw_type != HPHW_IOA) {
-                       printk(KERN_INFO "Serial: device 0x%lx not configured.\n"
+               if (parisc_parent(dev)->id.hw_type != HPHW_IOA)
+                       printk(KERN_INFO
+                               "Serial: device 0x%lx not configured.\n"
                                "Enable support for Wax, Lasi, Asp or Dino.\n",
                                dev->hpa.start);
-               }
                return -ENODEV;
        }
 
        address = dev->hpa.start;
-       if (dev->id.sversion != 0x8d) {
+       if (dev->id.sversion != 0x8d)
                address += 0x800;
-       }
 
-       memset(&port, 0, sizeof(struct uart_port));
-       port.mapbase = address;
-       port.irq = dev->irq;
-       port.iotype = UPIO_MEM;
-       port.flags = UPF_IOREMAP | UPF_BOOT_AUTOCONF;
-       port.uartclk = LASI_BASE_BAUD * 16;
-       port.dev = &dev->dev;
+       memset(&port, 0, sizeof(port));
+       port.iotype     = UPIO_MEM;
+       /* 7.272727MHz on Lasi.  Assumed the same for Dino, Wax and Timi. */
+       port.uartclk    = 7272727;
+       port.mapbase    = address;
+       port.membase    = ioremap_nocache(address, 16);
+       port.irq        = dev->irq;
+       port.flags      = UPF_BOOT_AUTOCONF;
+       port.dev        = &dev->dev;
 
        err = serial8250_register_port(&port);
        if (err < 0) {
-               printk(KERN_WARNING "serial8250_register_port returned error %d\n", err);
+               printk(KERN_WARNING
+                       "serial8250_register_port returned error %d\n", err);
+               iounmap(port.membase);
                return err;
        }
-        
+
        return 0;
 }
 
@@ -111,7 +111,7 @@ static struct parisc_driver serial_driver = {
        .probe          = serial_init_chip,
 };
 
-int __init probe_serial_gsc(void)
+static int __init probe_serial_gsc(void)
 {
        register_parisc_driver(&lasi_driver);
        register_parisc_driver(&serial_driver);
@@ -119,3 +119,5 @@ int __init probe_serial_gsc(void)
 }
 
 module_init(probe_serial_gsc);
+
+MODULE_LICENSE("GPL");