diff options
-rw-r--r-- | drivers/pci/probe.c | 15 | ||||
-rw-r--r-- | include/linux/pci.h | 2 |
2 files changed, 17 insertions, 0 deletions
diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c index 629edf39a07d..70d37bbf09bb 100644 --- a/drivers/pci/probe.c +++ b/drivers/pci/probe.c | |||
@@ -846,6 +846,21 @@ static void pci_release_bus_bridge_dev(struct device *dev) | |||
846 | kfree(dev); | 846 | kfree(dev); |
847 | } | 847 | } |
848 | 848 | ||
849 | struct pci_dev *alloc_pci_dev(void) | ||
850 | { | ||
851 | struct pci_dev *dev; | ||
852 | |||
853 | dev = kzalloc(sizeof(struct pci_dev), GFP_KERNEL); | ||
854 | if (!dev) | ||
855 | return NULL; | ||
856 | |||
857 | INIT_LIST_HEAD(&dev->global_list); | ||
858 | INIT_LIST_HEAD(&dev->bus_list); | ||
859 | |||
860 | return dev; | ||
861 | } | ||
862 | EXPORT_SYMBOL(alloc_pci_dev); | ||
863 | |||
849 | /* | 864 | /* |
850 | * Read the config data for a PCI device, sanity-check it | 865 | * Read the config data for a PCI device, sanity-check it |
851 | * and fill in the dev structure... | 866 | * and fill in the dev structure... |
diff --git a/include/linux/pci.h b/include/linux/pci.h index 99d45751830c..c02074785d40 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h | |||
@@ -193,6 +193,8 @@ struct pci_dev { | |||
193 | #endif | 193 | #endif |
194 | }; | 194 | }; |
195 | 195 | ||
196 | extern struct pci_dev *alloc_pci_dev(void); | ||
197 | |||
196 | #define pci_dev_g(n) list_entry(n, struct pci_dev, global_list) | 198 | #define pci_dev_g(n) list_entry(n, struct pci_dev, global_list) |
197 | #define pci_dev_b(n) list_entry(n, struct pci_dev, bus_list) | 199 | #define pci_dev_b(n) list_entry(n, struct pci_dev, bus_list) |
198 | #define to_pci_dev(n) container_of(n, struct pci_dev, dev) | 200 | #define to_pci_dev(n) container_of(n, struct pci_dev, dev) |