aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/hotplug/acpiphp_glue.c
diff options
context:
space:
mode:
authorEric Sesterhenn <snakebyte@gmx.de>2006-02-28 09:34:49 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2006-03-23 17:35:17 -0500
commitf5afe8064f3087bead8fea7e32547c2a3ada5fd0 (patch)
treede6a9d60aad6ee262c04290d73e414cd92b4ad5d /drivers/pci/hotplug/acpiphp_glue.c
parent7c8f25da12a3dda46fb730699582895d5fc51287 (diff)
[PATCH] PCI: kzalloc() conversion in drivers/pci
this patch converts drivers/pci to kzalloc usage. Compile tested with allyes config. Signed-off-by: Eric Sesterhenn <snakebyte@gmx.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/pci/hotplug/acpiphp_glue.c')
-rw-r--r--drivers/pci/hotplug/acpiphp_glue.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/drivers/pci/hotplug/acpiphp_glue.c b/drivers/pci/hotplug/acpiphp_glue.c
index cbd5893d198e..c7e6387983df 100644
--- a/drivers/pci/hotplug/acpiphp_glue.c
+++ b/drivers/pci/hotplug/acpiphp_glue.c
@@ -143,10 +143,9 @@ register_slot(acpi_handle handle, u32 lvl, void *context, void **rv)
143 device = (adr >> 16) & 0xffff; 143 device = (adr >> 16) & 0xffff;
144 function = adr & 0xffff; 144 function = adr & 0xffff;
145 145
146 newfunc = kmalloc(sizeof(struct acpiphp_func), GFP_KERNEL); 146 newfunc = kzalloc(sizeof(struct acpiphp_func), GFP_KERNEL);
147 if (!newfunc) 147 if (!newfunc)
148 return AE_NO_MEMORY; 148 return AE_NO_MEMORY;
149 memset(newfunc, 0, sizeof(struct acpiphp_func));
150 149
151 INIT_LIST_HEAD(&newfunc->sibling); 150 INIT_LIST_HEAD(&newfunc->sibling);
152 newfunc->handle = handle; 151 newfunc->handle = handle;
@@ -189,13 +188,12 @@ register_slot(acpi_handle handle, u32 lvl, void *context, void **rv)
189 } 188 }
190 189
191 if (!slot) { 190 if (!slot) {
192 slot = kmalloc(sizeof(struct acpiphp_slot), GFP_KERNEL); 191 slot = kzalloc(sizeof(struct acpiphp_slot), GFP_KERNEL);
193 if (!slot) { 192 if (!slot) {
194 kfree(newfunc); 193 kfree(newfunc);
195 return AE_NO_MEMORY; 194 return AE_NO_MEMORY;
196 } 195 }
197 196
198 memset(slot, 0, sizeof(struct acpiphp_slot));
199 slot->bridge = bridge; 197 slot->bridge = bridge;
200 slot->device = device; 198 slot->device = device;
201 slot->sun = sun; 199 slot->sun = sun;
@@ -376,12 +374,10 @@ static void add_host_bridge(acpi_handle *handle, struct pci_bus *pci_bus)
376{ 374{
377 struct acpiphp_bridge *bridge; 375 struct acpiphp_bridge *bridge;
378 376
379 bridge = kmalloc(sizeof(struct acpiphp_bridge), GFP_KERNEL); 377 bridge = kzalloc(sizeof(struct acpiphp_bridge), GFP_KERNEL);
380 if (bridge == NULL) 378 if (bridge == NULL)
381 return; 379 return;
382 380
383 memset(bridge, 0, sizeof(struct acpiphp_bridge));
384
385 bridge->type = BRIDGE_TYPE_HOST; 381 bridge->type = BRIDGE_TYPE_HOST;
386 bridge->handle = handle; 382 bridge->handle = handle;
387 383
@@ -398,14 +394,12 @@ static void add_p2p_bridge(acpi_handle *handle, struct pci_dev *pci_dev)
398{ 394{
399 struct acpiphp_bridge *bridge; 395 struct acpiphp_bridge *bridge;
400 396
401 bridge = kmalloc(sizeof(struct acpiphp_bridge), GFP_KERNEL); 397 bridge = kzalloc(sizeof(struct acpiphp_bridge), GFP_KERNEL);
402 if (bridge == NULL) { 398 if (bridge == NULL) {
403 err("out of memory\n"); 399 err("out of memory\n");
404 return; 400 return;
405 } 401 }
406 402
407 memset(bridge, 0, sizeof(struct acpiphp_bridge));
408
409 bridge->type = BRIDGE_TYPE_P2P; 403 bridge->type = BRIDGE_TYPE_P2P;
410 bridge->handle = handle; 404 bridge->handle = handle;
411 405