aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorMichael Ellerman <michael@ellerman.id.au>2007-04-05 03:19:09 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2007-05-02 22:02:37 -0400
commitbab41e9be75121c473b00df2ffa33af3c44066a7 (patch)
treecd519c2a32c951914ec7e7f909ae3822313f594c /drivers
parent65891215e6b822c368fb3f36abf129ed48af8be0 (diff)
PCI: Convert to alloc_pci_dev()
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>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/char/agp/alpha-agp.c2
-rw-r--r--drivers/char/agp/parisc-agp.c2
-rw-r--r--drivers/pci/hotplug/fakephp.c2
-rw-r--r--drivers/pci/probe.c2
-rw-r--r--drivers/scsi/megaraid.c2
5 files changed, 5 insertions, 5 deletions
diff --git a/drivers/char/agp/alpha-agp.c b/drivers/char/agp/alpha-agp.c
index b0acf41c0db9..aa8f3a39a704 100644
--- a/drivers/char/agp/alpha-agp.c
+++ b/drivers/char/agp/alpha-agp.c
@@ -173,7 +173,7 @@ alpha_core_agp_setup(void)
173 /* 173 /*
174 * Build a fake pci_dev struct 174 * Build a fake pci_dev struct
175 */ 175 */
176 pdev = kmalloc(sizeof(struct pci_dev), GFP_KERNEL); 176 pdev = alloc_pci_dev();
177 if (!pdev) 177 if (!pdev)
178 return -ENOMEM; 178 return -ENOMEM;
179 pdev->vendor = 0xffff; 179 pdev->vendor = 0xffff;
diff --git a/drivers/char/agp/parisc-agp.c b/drivers/char/agp/parisc-agp.c
index 3d83b461ccad..f4562cc22343 100644
--- a/drivers/char/agp/parisc-agp.c
+++ b/drivers/char/agp/parisc-agp.c
@@ -329,7 +329,7 @@ parisc_agp_setup(void __iomem *ioc_hpa, void __iomem *lba_hpa)
329 struct agp_bridge_data *bridge; 329 struct agp_bridge_data *bridge;
330 int error = 0; 330 int error = 0;
331 331
332 fake_bridge_dev = kmalloc(sizeof (struct pci_dev), GFP_KERNEL); 332 fake_bridge_dev = alloc_pci_dev();
333 if (!fake_bridge_dev) { 333 if (!fake_bridge_dev) {
334 error = -ENOMEM; 334 error = -ENOMEM;
335 goto fail; 335 goto fail;
diff --git a/drivers/pci/hotplug/fakephp.c b/drivers/pci/hotplug/fakephp.c
index e27907c91d92..027f6865d7e3 100644
--- a/drivers/pci/hotplug/fakephp.c
+++ b/drivers/pci/hotplug/fakephp.c
@@ -238,7 +238,7 @@ static void pci_rescan_bus(const struct pci_bus *bus)
238{ 238{
239 unsigned int devfn; 239 unsigned int devfn;
240 struct pci_dev *dev; 240 struct pci_dev *dev;
241 dev = kzalloc(sizeof(struct pci_dev), GFP_KERNEL); 241 dev = alloc_pci_dev();
242 if (!dev) 242 if (!dev)
243 return; 243 return;
244 244
diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
index 70d37bbf09bb..c659f8ae441a 100644
--- a/drivers/pci/probe.c
+++ b/drivers/pci/probe.c
@@ -900,7 +900,7 @@ pci_scan_device(struct pci_bus *bus, int devfn)
900 if (pci_bus_read_config_byte(bus, devfn, PCI_HEADER_TYPE, &hdr_type)) 900 if (pci_bus_read_config_byte(bus, devfn, PCI_HEADER_TYPE, &hdr_type))
901 return NULL; 901 return NULL;
902 902
903 dev = kzalloc(sizeof(struct pci_dev), GFP_KERNEL); 903 dev = alloc_pci_dev();
904 if (!dev) 904 if (!dev)
905 return NULL; 905 return NULL;
906 906
diff --git a/drivers/scsi/megaraid.c b/drivers/scsi/megaraid.c
index 0aa3304f6b9b..7fc6e06ea7e1 100644
--- a/drivers/scsi/megaraid.c
+++ b/drivers/scsi/megaraid.c
@@ -2088,7 +2088,7 @@ megaraid_abort_and_reset(adapter_t *adapter, Scsi_Cmnd *cmd, int aor)
2088static inline int 2088static inline int
2089make_local_pdev(adapter_t *adapter, struct pci_dev **pdev) 2089make_local_pdev(adapter_t *adapter, struct pci_dev **pdev)
2090{ 2090{
2091 *pdev = kmalloc(sizeof(struct pci_dev), GFP_KERNEL); 2091 *pdev = alloc_pci_dev();
2092 2092
2093 if( *pdev == NULL ) return -1; 2093 if( *pdev == NULL ) return -1;
2094 2094