aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/hotplug/pciehp_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/pciehp_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/pciehp_core.c')
-rw-r--r--drivers/pci/hotplug/pciehp_core.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/drivers/pci/hotplug/pciehp_core.c b/drivers/pci/hotplug/pciehp_core.c
index 1e8506e0fd87..601cf9045b20 100644
--- a/drivers/pci/hotplug/pciehp_core.c
+++ b/drivers/pci/hotplug/pciehp_core.c
@@ -117,27 +117,23 @@ static int init_slots(struct controller *ctrl)
117 slot_number = ctrl->first_slot; 117 slot_number = ctrl->first_slot;
118 118
119 while (number_of_slots) { 119 while (number_of_slots) {
120 slot = kmalloc(sizeof(*slot), GFP_KERNEL); 120 slot = kzalloc(sizeof(*slot), GFP_KERNEL);
121 if (!slot) 121 if (!slot)
122 goto error; 122 goto error;
123 123
124 memset(slot, 0, sizeof(struct slot));
125 slot->hotplug_slot = 124 slot->hotplug_slot =
126 kmalloc(sizeof(*(slot->hotplug_slot)), 125 kzalloc(sizeof(*(slot->hotplug_slot)),
127 GFP_KERNEL); 126 GFP_KERNEL);
128 if (!slot->hotplug_slot) 127 if (!slot->hotplug_slot)
129 goto error_slot; 128 goto error_slot;
130 hotplug_slot = slot->hotplug_slot; 129 hotplug_slot = slot->hotplug_slot;
131 memset(hotplug_slot, 0, sizeof(struct hotplug_slot));
132 130
133 hotplug_slot->info = 131 hotplug_slot->info =
134 kmalloc(sizeof(*(hotplug_slot->info)), 132 kzalloc(sizeof(*(hotplug_slot->info)),
135 GFP_KERNEL); 133 GFP_KERNEL);
136 if (!hotplug_slot->info) 134 if (!hotplug_slot->info)
137 goto error_hpslot; 135 goto error_hpslot;
138 hotplug_slot_info = hotplug_slot->info; 136 hotplug_slot_info = hotplug_slot->info;
139 memset(hotplug_slot_info, 0,
140 sizeof(struct hotplug_slot_info));
141 hotplug_slot->name = kmalloc(SLOT_NAME_SIZE, GFP_KERNEL); 137 hotplug_slot->name = kmalloc(SLOT_NAME_SIZE, GFP_KERNEL);
142 if (!hotplug_slot->name) 138 if (!hotplug_slot->name)
143 goto error_info; 139 goto error_info;
@@ -373,12 +369,11 @@ static int pciehp_probe(struct pcie_device *dev, const struct pcie_port_service_
373 u8 value; 369 u8 value;
374 struct pci_dev *pdev; 370 struct pci_dev *pdev;
375 371
376 ctrl = kmalloc(sizeof(*ctrl), GFP_KERNEL); 372 ctrl = kzalloc(sizeof(*ctrl), GFP_KERNEL);
377 if (!ctrl) { 373 if (!ctrl) {
378 err("%s : out of memory\n", __FUNCTION__); 374 err("%s : out of memory\n", __FUNCTION__);
379 goto err_out_none; 375 goto err_out_none;
380 } 376 }
381 memset(ctrl, 0, sizeof(struct controller));
382 377
383 pdev = dev->port; 378 pdev = dev->port;
384 ctrl->pci_dev = pdev; 379 ctrl->pci_dev = pdev;