mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-26 08:31:13 +00:00
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>
This commit is contained in:
parent
c9953a73e9
commit
65891215e6
2 changed files with 17 additions and 0 deletions
|
@ -193,6 +193,8 @@ struct pci_dev {
|
|||
#endif
|
||||
};
|
||||
|
||||
extern struct pci_dev *alloc_pci_dev(void);
|
||||
|
||||
#define pci_dev_g(n) list_entry(n, struct pci_dev, global_list)
|
||||
#define pci_dev_b(n) list_entry(n, struct pci_dev, bus_list)
|
||||
#define to_pci_dev(n) container_of(n, struct pci_dev, dev)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue