aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/probe.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/probe.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/probe.c')
-rw-r--r--drivers/pci/probe.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
index e3dc3063e05b..a10ed9dab2c2 100644
--- a/drivers/pci/probe.c
+++ b/drivers/pci/probe.c
@@ -33,10 +33,9 @@ LIST_HEAD(pci_devices);
33 */ 33 */
34static void pci_create_legacy_files(struct pci_bus *b) 34static void pci_create_legacy_files(struct pci_bus *b)
35{ 35{
36 b->legacy_io = kmalloc(sizeof(struct bin_attribute) * 2, 36 b->legacy_io = kzalloc(sizeof(struct bin_attribute) * 2,
37 GFP_ATOMIC); 37 GFP_ATOMIC);
38 if (b->legacy_io) { 38 if (b->legacy_io) {
39 memset(b->legacy_io, 0, sizeof(struct bin_attribute) * 2);
40 b->legacy_io->attr.name = "legacy_io"; 39 b->legacy_io->attr.name = "legacy_io";
41 b->legacy_io->size = 0xffff; 40 b->legacy_io->size = 0xffff;
42 b->legacy_io->attr.mode = S_IRUSR | S_IWUSR; 41 b->legacy_io->attr.mode = S_IRUSR | S_IWUSR;
@@ -320,9 +319,8 @@ static struct pci_bus * __devinit pci_alloc_bus(void)
320{ 319{
321 struct pci_bus *b; 320 struct pci_bus *b;
322 321
323 b = kmalloc(sizeof(*b), GFP_KERNEL); 322 b = kzalloc(sizeof(*b), GFP_KERNEL);
324 if (b) { 323 if (b) {
325 memset(b, 0, sizeof(*b));
326 INIT_LIST_HEAD(&b->node); 324 INIT_LIST_HEAD(&b->node);
327 INIT_LIST_HEAD(&b->children); 325 INIT_LIST_HEAD(&b->children);
328 INIT_LIST_HEAD(&b->devices); 326 INIT_LIST_HEAD(&b->devices);
@@ -797,11 +795,10 @@ pci_scan_device(struct pci_bus *bus, int devfn)
797 if (pci_bus_read_config_byte(bus, devfn, PCI_HEADER_TYPE, &hdr_type)) 795 if (pci_bus_read_config_byte(bus, devfn, PCI_HEADER_TYPE, &hdr_type))
798 return NULL; 796 return NULL;
799 797
800 dev = kmalloc(sizeof(struct pci_dev), GFP_KERNEL); 798 dev = kzalloc(sizeof(struct pci_dev), GFP_KERNEL);
801 if (!dev) 799 if (!dev)
802 return NULL; 800 return NULL;
803 801
804 memset(dev, 0, sizeof(struct pci_dev));
805 dev->bus = bus; 802 dev->bus = bus;
806 dev->sysdata = bus->sysdata; 803 dev->sysdata = bus->sysdata;
807 dev->dev.parent = bus->bridge; 804 dev->dev.parent = bus->bridge;