nfsd4: fix null dereference creating nfsv4 callback client
[safe/jmp/linux-2.6] / drivers / parisc / lasi.c
index cb84a4e..e65727c 100644 (file)
@@ -107,7 +107,7 @@ lasi_init_irq(struct gsc_asic *this_lasi)
 
 #else
 
-void __init lasi_led_init(unsigned long lasi_hpa)
+static void __init lasi_led_init(unsigned long lasi_hpa)
 {
        unsigned long datareg;
 
@@ -150,7 +150,7 @@ void __init lasi_led_init(unsigned long lasi_hpa)
  * 
  */
 
-static unsigned long lasi_power_off_hpa;
+static unsigned long lasi_power_off_hpa __read_mostly;
 
 static void lasi_power_off(void)
 {
@@ -163,19 +163,19 @@ static void lasi_power_off(void)
        gsc_writel(0x02, datareg);
 }
 
-int __init
-lasi_init_chip(struct parisc_device *dev)
+static int __init lasi_init_chip(struct parisc_device *dev)
 {
+       extern void (*chassis_power_off)(void);
        struct gsc_asic *lasi;
        struct gsc_irq gsc_irq;
        int ret;
 
-       lasi = kmalloc(sizeof(*lasi), GFP_KERNEL);
+       lasi = kzalloc(sizeof(*lasi), GFP_KERNEL);
        if (!lasi)
                return -ENOMEM;
 
        lasi->name = "Lasi";
-       lasi->hpa = dev->hpa;
+       lasi->hpa = dev->hpa.start;
 
        /* Check the 4-bit (yes, only 4) version register */
        lasi->version = gsc_readl(lasi->hpa + LASI_VER) & 0xf;
@@ -192,7 +192,7 @@ lasi_init_chip(struct parisc_device *dev)
        dev->irq = gsc_alloc_irq(&gsc_irq);
        if (dev->irq < 0) {
                printk(KERN_ERR "%s(): cannot get GSC irq\n",
-                               __FUNCTION__);
+                               __func__);
                kfree(lasi);
                return -EBUSY;
        }
@@ -222,7 +222,7 @@ lasi_init_chip(struct parisc_device *dev)
         * ensure that only the first LASI (the one controlling the power off)
         * should set the HPA here */
        lasi_power_off_hpa = lasi->hpa;
-       pm_power_off = lasi_power_off;
+       chassis_power_off = lasi_power_off;
        
        return ret;
 }
@@ -233,7 +233,7 @@ static struct parisc_device_id lasi_tbl[] = {
 };
 
 struct parisc_driver lasi_driver = {
-       .name =         "Lasi",
+       .name =         "lasi",
        .id_table =     lasi_tbl,
        .probe =        lasi_init_chip,
 };