aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorMichael Ellerman <michael@ellerman.id.au>2007-04-05 03:19:08 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2007-05-02 22:02:37 -0400
commit65891215e6b822c368fb3f36abf129ed48af8be0 (patch)
tree6cc1de94ca66a8f627775d1ddff3600ee8236ed3 /include/linux
parentc9953a73e92df11edd812d863ff741877ea9e58c (diff)
PCI: Create alloc_pci_dev(), the one true way to create a struct pci_dev
There are currently several places in the kernel where we kmalloc() a struct pci_dev and start initialising it. It'd be preferable to have an allocator so we can ensure the pci_dev is correctly initialised in one place. Signed-off-by: Michael Ellerman <michael@ellerman.id.au> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/pci.h2
1 files changed, 2 insertions, 0 deletions
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
196extern 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)