]> err.no Git - linux-2.6/blobdiff - arch/sparc/mm/io-unit.c
Merge branch 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik...
[linux-2.6] / arch / sparc / mm / io-unit.c
index 2bb1309003dd9e6ba316fdf87df308f2bceb34b5..4ccda77d08d6bf7d180036f09d452b2813784676 100644 (file)
@@ -22,6 +22,7 @@
 #include <asm/cacheflush.h>
 #include <asm/tlbflush.h>
 #include <asm/dma.h>
+#include <asm/oplib.h>
 
 /* #define IOUNIT_DEBUG */
 #ifdef IOUNIT_DEBUG
@@ -41,9 +42,12 @@ iounit_init(int sbi_node, int io_node, struct sbus_bus *sbus)
        struct linux_prom_registers iommu_promregs[PROMREG_MAX];
        struct resource r;
 
-       iounit = kmalloc(sizeof(struct iounit_struct), GFP_ATOMIC);
+       iounit = kzalloc(sizeof(struct iounit_struct), GFP_ATOMIC);
+       if (!iounit) {
+               prom_printf("SUN4D: Cannot alloc iounit, halting.\n");
+               prom_halt();
+       }
 
-       memset(iounit, 0, sizeof(*iounit));
        iounit->limit[0] = IOUNIT_BMAP1_START;
        iounit->limit[1] = IOUNIT_BMAP2_START;
        iounit->limit[2] = IOUNIT_BMAPM_START;