aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/hotplug/cpqphp_core.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/cpqphp_core.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/cpqphp_core.c')
-rw-r--r--drivers/pci/hotplug/cpqphp_core.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/drivers/pci/hotplug/cpqphp_core.c b/drivers/pci/hotplug/cpqphp_core.c
index 8626901daeb8..9bc1deb8df52 100644
--- a/drivers/pci/hotplug/cpqphp_core.c
+++ b/drivers/pci/hotplug/cpqphp_core.c
@@ -347,26 +347,22 @@ static int ctrl_slot_setup(struct controller *ctrl,
347 slot_number = ctrl->first_slot; 347 slot_number = ctrl->first_slot;
348 348
349 while (number_of_slots) { 349 while (number_of_slots) {
350 slot = kmalloc(sizeof(*slot), GFP_KERNEL); 350 slot = kzalloc(sizeof(*slot), GFP_KERNEL);
351 if (!slot) 351 if (!slot)
352 goto error; 352 goto error;
353 353
354 memset(slot, 0, sizeof(struct slot)); 354 slot->hotplug_slot = kzalloc(sizeof(*(slot->hotplug_slot)),
355 slot->hotplug_slot = kmalloc(sizeof(*(slot->hotplug_slot)),
356 GFP_KERNEL); 355 GFP_KERNEL);
357 if (!slot->hotplug_slot) 356 if (!slot->hotplug_slot)
358 goto error_slot; 357 goto error_slot;
359 hotplug_slot = slot->hotplug_slot; 358 hotplug_slot = slot->hotplug_slot;
360 memset(hotplug_slot, 0, sizeof(struct hotplug_slot));
361 359
362 hotplug_slot->info = 360 hotplug_slot->info =
363 kmalloc(sizeof(*(hotplug_slot->info)), 361 kzalloc(sizeof(*(hotplug_slot->info)),
364 GFP_KERNEL); 362 GFP_KERNEL);
365 if (!hotplug_slot->info) 363 if (!hotplug_slot->info)
366 goto error_hpslot; 364 goto error_hpslot;
367 hotplug_slot_info = hotplug_slot->info; 365 hotplug_slot_info = hotplug_slot->info;
368 memset(hotplug_slot_info, 0,
369 sizeof(struct hotplug_slot_info));
370 hotplug_slot->name = kmalloc(SLOT_NAME_SIZE, GFP_KERNEL); 366 hotplug_slot->name = kmalloc(SLOT_NAME_SIZE, GFP_KERNEL);
371 367
372 if (!hotplug_slot->name) 368 if (!hotplug_slot->name)
@@ -854,13 +850,12 @@ static int cpqhpc_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
854 goto err_disable_device; 850 goto err_disable_device;
855 } 851 }
856 852
857 ctrl = (struct controller *) kmalloc(sizeof(struct controller), GFP_KERNEL); 853 ctrl = kzalloc(sizeof(struct controller), GFP_KERNEL);
858 if (!ctrl) { 854 if (!ctrl) {
859 err("%s : out of memory\n", __FUNCTION__); 855 err("%s : out of memory\n", __FUNCTION__);
860 rc = -ENOMEM; 856 rc = -ENOMEM;
861 goto err_disable_device; 857 goto err_disable_device;
862 } 858 }
863 memset(ctrl, 0, sizeof(struct controller));
864 859
865 rc = pci_read_config_word(pdev, PCI_SUBSYSTEM_ID, &subsystem_deviceid); 860 rc = pci_read_config_word(pdev, PCI_SUBSYSTEM_ID, &subsystem_deviceid);
866 if (rc) { 861 if (rc) {