aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sparc64/kernel/isa.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/sparc64/kernel/isa.c')
-rw-r--r--arch/sparc64/kernel/isa.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/arch/sparc64/kernel/isa.c b/arch/sparc64/kernel/isa.c
index f028e68b23f2..ad1c4f55420f 100644
--- a/arch/sparc64/kernel/isa.c
+++ b/arch/sparc64/kernel/isa.c
@@ -72,14 +72,12 @@ static void __init isa_fill_children(struct sparc_isa_device *parent_isa_dev)
72 struct linux_prom_registers *regs; 72 struct linux_prom_registers *regs;
73 struct sparc_isa_device *isa_dev; 73 struct sparc_isa_device *isa_dev;
74 74
75 isa_dev = kmalloc(sizeof(*isa_dev), GFP_KERNEL); 75 isa_dev = kzalloc(sizeof(*isa_dev), GFP_KERNEL);
76 if (!isa_dev) { 76 if (!isa_dev) {
77 fatal_err("cannot allocate child isa_dev"); 77 fatal_err("cannot allocate child isa_dev");
78 prom_halt(); 78 prom_halt();
79 } 79 }
80 80
81 memset(isa_dev, 0, sizeof(*isa_dev));
82
83 /* Link it in to parent. */ 81 /* Link it in to parent. */
84 isa_dev->next = parent_isa_dev->child; 82 isa_dev->next = parent_isa_dev->child;
85 parent_isa_dev->child = isa_dev; 83 parent_isa_dev->child = isa_dev;
@@ -104,14 +102,12 @@ static void __init isa_fill_devices(struct sparc_isa_bridge *isa_br)
104 struct linux_prom_registers *regs; 102 struct linux_prom_registers *regs;
105 struct sparc_isa_device *isa_dev; 103 struct sparc_isa_device *isa_dev;
106 104
107 isa_dev = kmalloc(sizeof(*isa_dev), GFP_KERNEL); 105 isa_dev = kzalloc(sizeof(*isa_dev), GFP_KERNEL);
108 if (!isa_dev) { 106 if (!isa_dev) {
109 printk(KERN_DEBUG "ISA: cannot allocate isa_dev"); 107 printk(KERN_DEBUG "ISA: cannot allocate isa_dev");
110 return; 108 return;
111 } 109 }
112 110
113 memset(isa_dev, 0, sizeof(*isa_dev));
114
115 isa_dev->ofdev.node = dp; 111 isa_dev->ofdev.node = dp;
116 isa_dev->ofdev.dev.parent = &isa_br->ofdev.dev; 112 isa_dev->ofdev.dev.parent = &isa_br->ofdev.dev;
117 isa_dev->ofdev.dev.bus = &isa_bus_type; 113 isa_dev->ofdev.dev.bus = &isa_bus_type;
@@ -180,14 +176,12 @@ void __init isa_init(void)
180 pbm = pdev_cookie->pbm; 176 pbm = pdev_cookie->pbm;
181 dp = pdev_cookie->prom_node; 177 dp = pdev_cookie->prom_node;
182 178
183 isa_br = kmalloc(sizeof(*isa_br), GFP_KERNEL); 179 isa_br = kzalloc(sizeof(*isa_br), GFP_KERNEL);
184 if (!isa_br) { 180 if (!isa_br) {
185 printk(KERN_DEBUG "isa: cannot allocate sparc_isa_bridge"); 181 printk(KERN_DEBUG "isa: cannot allocate sparc_isa_bridge");
186 return; 182 return;
187 } 183 }
188 184
189 memset(isa_br, 0, sizeof(*isa_br));
190
191 isa_br->ofdev.node = dp; 185 isa_br->ofdev.node = dp;
192 isa_br->ofdev.dev.parent = &pdev->dev; 186 isa_br->ofdev.dev.parent = &pdev->dev;
193 isa_br->ofdev.dev.bus = &isa_bus_type; 187 isa_br->ofdev.dev.bus = &isa_bus_type;