Commit bab41e9b authored by Michael Ellerman's avatar Michael Ellerman Committed by Greg Kroah-Hartman

PCI: Convert to alloc_pci_dev()

Convert code that allocs a struct pci_dev to use alloc_pci_dev().
Signed-off-by: default avatarMichael Ellerman <michael@ellerman.id.au>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 65891215
...@@ -340,7 +340,7 @@ struct pci_dev *of_create_pci_dev(struct device_node *node, ...@@ -340,7 +340,7 @@ struct pci_dev *of_create_pci_dev(struct device_node *node,
struct pci_dev *dev; struct pci_dev *dev;
const char *type; const char *type;
dev = kzalloc(sizeof(struct pci_dev), GFP_KERNEL); dev = alloc_pci_dev();
if (!dev) if (!dev)
return NULL; return NULL;
type = of_get_property(node, "device_type", NULL); type = of_get_property(node, "device_type", NULL);
......
...@@ -173,7 +173,7 @@ alpha_core_agp_setup(void) ...@@ -173,7 +173,7 @@ alpha_core_agp_setup(void)
/* /*
* Build a fake pci_dev struct * Build a fake pci_dev struct
*/ */
pdev = kmalloc(sizeof(struct pci_dev), GFP_KERNEL); pdev = alloc_pci_dev();
if (!pdev) if (!pdev)
return -ENOMEM; return -ENOMEM;
pdev->vendor = 0xffff; pdev->vendor = 0xffff;
......
...@@ -329,7 +329,7 @@ parisc_agp_setup(void __iomem *ioc_hpa, void __iomem *lba_hpa) ...@@ -329,7 +329,7 @@ parisc_agp_setup(void __iomem *ioc_hpa, void __iomem *lba_hpa)
struct agp_bridge_data *bridge; struct agp_bridge_data *bridge;
int error = 0; int error = 0;
fake_bridge_dev = kmalloc(sizeof (struct pci_dev), GFP_KERNEL); fake_bridge_dev = alloc_pci_dev();
if (!fake_bridge_dev) { if (!fake_bridge_dev) {
error = -ENOMEM; error = -ENOMEM;
goto fail; goto fail;
......
...@@ -238,7 +238,7 @@ static void pci_rescan_bus(const struct pci_bus *bus) ...@@ -238,7 +238,7 @@ static void pci_rescan_bus(const struct pci_bus *bus)
{ {
unsigned int devfn; unsigned int devfn;
struct pci_dev *dev; struct pci_dev *dev;
dev = kzalloc(sizeof(struct pci_dev), GFP_KERNEL); dev = alloc_pci_dev();
if (!dev) if (!dev)
return; return;
......
...@@ -900,7 +900,7 @@ pci_scan_device(struct pci_bus *bus, int devfn) ...@@ -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)) if (pci_bus_read_config_byte(bus, devfn, PCI_HEADER_TYPE, &hdr_type))
return NULL; return NULL;
dev = kzalloc(sizeof(struct pci_dev), GFP_KERNEL); dev = alloc_pci_dev();
if (!dev) if (!dev)
return NULL; return NULL;
......
...@@ -2088,7 +2088,7 @@ megaraid_abort_and_reset(adapter_t *adapter, Scsi_Cmnd *cmd, int aor) ...@@ -2088,7 +2088,7 @@ megaraid_abort_and_reset(adapter_t *adapter, Scsi_Cmnd *cmd, int aor)
static inline int static inline int
make_local_pdev(adapter_t *adapter, struct pci_dev **pdev) 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; if( *pdev == NULL ) return -1;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment