aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sparc/mm/io-unit.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/sparc/mm/io-unit.c')
-rw-r--r--arch/sparc/mm/io-unit.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/arch/sparc/mm/io-unit.c b/arch/sparc/mm/io-unit.c
index 2bb1309003dd..4ccda77d08d6 100644
--- a/arch/sparc/mm/io-unit.c
+++ b/arch/sparc/mm/io-unit.c
@@ -22,6 +22,7 @@
22#include <asm/cacheflush.h> 22#include <asm/cacheflush.h>
23#include <asm/tlbflush.h> 23#include <asm/tlbflush.h>
24#include <asm/dma.h> 24#include <asm/dma.h>
25#include <asm/oplib.h>
25 26
26/* #define IOUNIT_DEBUG */ 27/* #define IOUNIT_DEBUG */
27#ifdef IOUNIT_DEBUG 28#ifdef IOUNIT_DEBUG
@@ -41,9 +42,12 @@ iounit_init(int sbi_node, int io_node, struct sbus_bus *sbus)
41 struct linux_prom_registers iommu_promregs[PROMREG_MAX]; 42 struct linux_prom_registers iommu_promregs[PROMREG_MAX];
42 struct resource r; 43 struct resource r;
43 44
44 iounit = kmalloc(sizeof(struct iounit_struct), GFP_ATOMIC); 45 iounit = kzalloc(sizeof(struct iounit_struct), GFP_ATOMIC);
46 if (!iounit) {
47 prom_printf("SUN4D: Cannot alloc iounit, halting.\n");
48 prom_halt();
49 }
45 50
46 memset(iounit, 0, sizeof(*iounit));
47 iounit->limit[0] = IOUNIT_BMAP1_START; 51 iounit->limit[0] = IOUNIT_BMAP1_START;
48 iounit->limit[1] = IOUNIT_BMAP2_START; 52 iounit->limit[1] = IOUNIT_BMAP2_START;
49 iounit->limit[2] = IOUNIT_BMAPM_START; 53 iounit->limit[2] = IOUNIT_BMAPM_START;