]> err.no Git - linux-2.6/commitdiff
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 60d7d4baa227bb6359e79ece0123ab9b89d03ee3..7138092826aa4ce99fcabcc21d52217dc3a21d5d 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 b0acf41c0db9d5f7997783371ac501d55ca89b8f..aa8f3a39a7044d74fe1652d62ef077fc470b024b 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 3d83b461ccadef926c80f8217de6e2688840557d..f4562cc22343759b10a280302573f9f26ae0c405 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 e27907c91d9232ab99e7fd8261d1983c19f71680..027f6865d7e31cdbf1ce80711f076b66c24cbb8c 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 70d37bbf09bb8399205a2d7a459ef81deb9eae4d..c659f8ae441acf57789bed7d9c1e6d73fc66355d 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 0aa3304f6b9be310982fe2e8ba80c1c841c9c8a4..7fc6e06ea7e19e2780f8c1fd9b608115ab71f0a9 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;