PCI: Convert to alloc_pci_dev()
authorMichael Ellerman <michael@ellerman.id.au>
Thu, 5 Apr 2007 07:19:09 +0000 (17:19 +1000)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 3 May 2007 02:02:37 +0000 (19:02 -0700)
Convert code that allocs a struct pci_dev to use alloc_pci_dev().

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
arch/powerpc/kernel/pci_64.c
drivers/char/agp/alpha-agp.c
drivers/char/agp/parisc-agp.c
drivers/pci/hotplug/fakephp.c
drivers/pci/probe.c
drivers/scsi/megaraid.c

index 60d7d4b..7138092 100644 (file)
@@ -340,7 +340,7 @@ struct pci_dev *of_create_pci_dev(struct device_node *node,
        struct pci_dev *dev;
        const char *type;
 
-       dev = kzalloc(sizeof(struct pci_dev), GFP_KERNEL);
+       dev = alloc_pci_dev();
        if (!dev)
                return NULL;
        type = of_get_property(node, "device_type", NULL);
index b0acf41..aa8f3a3 100644 (file)
@@ -173,7 +173,7 @@ alpha_core_agp_setup(void)
        /*
         * Build a fake pci_dev struct
         */
-       pdev = kmalloc(sizeof(struct pci_dev), GFP_KERNEL);
+       pdev = alloc_pci_dev();
        if (!pdev)
                return -ENOMEM;
        pdev->vendor = 0xffff;
index 3d83b46..f4562cc 100644 (file)
@@ -329,7 +329,7 @@ parisc_agp_setup(void __iomem *ioc_hpa, void __iomem *lba_hpa)
        struct agp_bridge_data *bridge;
        int error = 0;
 
-       fake_bridge_dev = kmalloc(sizeof (struct pci_dev), GFP_KERNEL);
+       fake_bridge_dev = alloc_pci_dev();
        if (!fake_bridge_dev) {
                error = -ENOMEM;
                goto fail;
index e27907c..027f686 100644 (file)
@@ -238,7 +238,7 @@ static void pci_rescan_bus(const struct pci_bus *bus)
 {
        unsigned int devfn;
        struct pci_dev *dev;
-       dev = kzalloc(sizeof(struct pci_dev), GFP_KERNEL);
+       dev = alloc_pci_dev();
        if (!dev)
                return;
 
index 70d37bb..c659f8a 100644 (file)
@@ -900,7 +900,7 @@ pci_scan_device(struct pci_bus *bus, int devfn)
        if (pci_bus_read_config_byte(bus, devfn, PCI_HEADER_TYPE, &hdr_type))
                return NULL;
 
-       dev = kzalloc(sizeof(struct pci_dev), GFP_KERNEL);
+       dev = alloc_pci_dev();
        if (!dev)
                return NULL;
 
index 0aa3304..7fc6e06 100644 (file)
@@ -2088,7 +2088,7 @@ megaraid_abort_and_reset(adapter_t *adapter, Scsi_Cmnd *cmd, int aor)
 static inline int
 make_local_pdev(adapter_t *adapter, struct pci_dev **pdev)
 {
-       *pdev = kmalloc(sizeof(struct pci_dev), GFP_KERNEL);
+       *pdev = alloc_pci_dev();
 
        if( *pdev == NULL ) return -1;