diff --git a/arch/microblaze/include/asm/pci-bridge.h b/arch/microblaze/include/asm/pci-bridge.h index 0d74d031e2a3184282a503213fe6929f0e965a82..242be57a319c7878b17bacd2e940ba6ab26a6e81 100644 --- a/arch/microblaze/include/asm/pci-bridge.h +++ b/arch/microblaze/include/asm/pci-bridge.h @@ -102,11 +102,6 @@ struct pci_controller { }; #ifdef CONFIG_PCI -static inline struct device_node *pci_bus_to_OF_node(struct pci_bus *bus) -{ - return bus->dev.of_node; -} - static inline struct pci_controller *pci_bus_to_host(const struct pci_bus *bus) { return bus->sysdata; diff --git a/arch/powerpc/include/asm/pci-bridge.h b/arch/powerpc/include/asm/pci-bridge.h index 578060ef99ad6df3abb50ba7c7e3cb1e3e4044e3..90bd3ed4816505b43e54a846de34b38b4585cb4a 100644 --- a/arch/powerpc/include/asm/pci-bridge.h +++ b/arch/powerpc/include/asm/pci-bridge.h @@ -169,11 +169,6 @@ static inline struct pci_controller *pci_bus_to_host(const struct pci_bus *bus) return bus->sysdata; } -static inline struct device_node *pci_bus_to_OF_node(struct pci_bus *bus) -{ - return bus->dev.of_node; -} - #ifndef CONFIG_PPC64 extern int pci_device_from_OF_node(struct device_node *node, diff --git a/arch/x86/include/asm/prom.h b/arch/x86/include/asm/prom.h index dd6066a56346e12febdb30b19e84c5037c43c4ae..df1287019e6d73d3991ff5ba73c441765c37c629 100644 --- a/arch/x86/include/asm/prom.h +++ b/arch/x86/include/asm/prom.h @@ -30,12 +30,6 @@ extern void add_dtb(u64 data); extern void x86_add_irq_domains(void); void __cpuinit x86_of_pci_init(void); void x86_dtb_init(void); - -static inline struct device_node *pci_bus_to_OF_node(struct pci_bus *bus) -{ - return pci_device_to_OF_node(bus->self); -} - #else static inline void add_dtb(u64 data) { } static inline void x86_add_irq_domains(void) { } diff --git a/include/linux/pci.h b/include/linux/pci.h index 795e6a56d8cd767e0ca3053c37936479554d325c..2d292182dde548316b6cc6804df35383c9ccb015 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h @@ -1605,6 +1605,11 @@ static inline struct device_node *pci_device_to_OF_node(struct pci_dev *pdev) return pdev ? pdev->dev.of_node : NULL; } +static inline struct device_node *pci_bus_to_OF_node(struct pci_bus *bus) +{ + return bus ? bus->dev.of_node : NULL; +} + #else /* CONFIG_OF */ static inline void pci_set_of_node(struct pci_dev *dev) { } static inline void pci_release_of_node(struct pci_dev *dev) { }