Merge to kernel-2.6.20-1.2949.fc6.vs2.2.0.1
[linux-2.6.git] / arch / sparc / kernel / auxio.c
index 4bb41a1..118f3ec 100644 (file)
@@ -5,7 +5,6 @@
 
 #include <linux/stddef.h>
 #include <linux/init.h>
-#include <linux/config.h>
 #include <linux/spinlock.h>
 #include <asm/oplib.h>
 #include <asm/io.h>
@@ -18,7 +17,7 @@
  * in entry.S::floppy_tdone
  */
 void __iomem *auxio_register = NULL;
-static spinlock_t auxio_lock = SPIN_LOCK_UNLOCKED;
+static DEFINE_SPINLOCK(auxio_lock);
 
 void __init auxio_probe(void)
 {
@@ -53,7 +52,8 @@ void __init auxio_probe(void)
 #endif
                }
        }
-       prom_getproperty(auxio_nd, "reg", (char *) auxregs, sizeof(auxregs));
+       if(prom_getproperty(auxio_nd, "reg", (char *) auxregs, sizeof(auxregs)) <= 0)
+               return;
        prom_apply_obio_ranges(auxregs, 0x1);
        /* Map the register both read and write */
        r.flags = auxregs[0].which_io & 0xF;
@@ -121,7 +121,8 @@ void __init auxio_power_probe(void)
                return;
 
        /* Map the power control register. */
-       prom_getproperty(node, "reg", (char *)&regs, sizeof(regs));
+       if (prom_getproperty(node, "reg", (char *)&regs, sizeof(regs)) <= 0)
+               return;
        prom_apply_obio_ranges(&regs, 1);
        memset(&r, 0, sizeof(r));
        r.flags = regs.which_io & 0xF;