Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Michael Ellerman and committed by
Greg Kroah-Hartman
bab41e9b 65891215

+6 -6
+1 -1
arch/powerpc/kernel/pci_64.c
··· 340 340 struct pci_dev *dev; 341 341 const char *type; 342 342 343 - dev = kzalloc(sizeof(struct pci_dev), GFP_KERNEL); 343 + dev = alloc_pci_dev(); 344 344 if (!dev) 345 345 return NULL; 346 346 type = of_get_property(node, "device_type", NULL);
+1 -1
drivers/char/agp/alpha-agp.c
··· 173 173 /* 174 174 * Build a fake pci_dev struct 175 175 */ 176 - pdev = kmalloc(sizeof(struct pci_dev), GFP_KERNEL); 176 + pdev = alloc_pci_dev(); 177 177 if (!pdev) 178 178 return -ENOMEM; 179 179 pdev->vendor = 0xffff;
+1 -1
drivers/char/agp/parisc-agp.c
··· 329 329 struct agp_bridge_data *bridge; 330 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 333 if (!fake_bridge_dev) { 334 334 error = -ENOMEM; 335 335 goto fail;
+1 -1
drivers/pci/hotplug/fakephp.c
··· 238 238 { 239 239 unsigned int devfn; 240 240 struct pci_dev *dev; 241 - dev = kzalloc(sizeof(struct pci_dev), GFP_KERNEL); 241 + dev = alloc_pci_dev(); 242 242 if (!dev) 243 243 return; 244 244
+1 -1
drivers/pci/probe.c
··· 900 900 if (pci_bus_read_config_byte(bus, devfn, PCI_HEADER_TYPE, &hdr_type)) 901 901 return NULL; 902 902 903 - dev = kzalloc(sizeof(struct pci_dev), GFP_KERNEL); 903 + dev = alloc_pci_dev(); 904 904 if (!dev) 905 905 return NULL; 906 906
+1 -1
drivers/scsi/megaraid.c
··· 2088 2088 static inline int 2089 2089 make_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 2093 if( *pdev == NULL ) return -1; 2094 2094