pci/of: Consolidate pci_bus_to_OF_node()

The generic code always get the device-node in the right place now
so a single implementation will work for all archs
Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
Acked-by: default avatarGrant Likely <grant.likely@secretlab.ca>
Acked-by: default avatarMichal Simek <monstr@monstr.eu>
Acked-by: default avatarJesse Barnes <jbarnes@virtuousgeek.org>
parent 64099d98
...@@ -102,11 +102,6 @@ struct pci_controller { ...@@ -102,11 +102,6 @@ struct pci_controller {
}; };
#ifdef CONFIG_PCI #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) static inline struct pci_controller *pci_bus_to_host(const struct pci_bus *bus)
{ {
return bus->sysdata; return bus->sysdata;
......
...@@ -169,11 +169,6 @@ static inline struct pci_controller *pci_bus_to_host(const struct pci_bus *bus) ...@@ -169,11 +169,6 @@ static inline struct pci_controller *pci_bus_to_host(const struct pci_bus *bus)
return bus->sysdata; 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 #ifndef CONFIG_PPC64
extern int pci_device_from_OF_node(struct device_node *node, extern int pci_device_from_OF_node(struct device_node *node,
......
...@@ -30,12 +30,6 @@ extern void add_dtb(u64 data); ...@@ -30,12 +30,6 @@ extern void add_dtb(u64 data);
extern void x86_add_irq_domains(void); extern void x86_add_irq_domains(void);
void __cpuinit x86_of_pci_init(void); void __cpuinit x86_of_pci_init(void);
void x86_dtb_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 #else
static inline void add_dtb(u64 data) { } static inline void add_dtb(u64 data) { }
static inline void x86_add_irq_domains(void) { } static inline void x86_add_irq_domains(void) { }
......
...@@ -1605,6 +1605,11 @@ static inline struct device_node *pci_device_to_OF_node(struct pci_dev *pdev) ...@@ -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; 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 */ #else /* CONFIG_OF */
static inline void pci_set_of_node(struct pci_dev *dev) { } static inline void pci_set_of_node(struct pci_dev *dev) { }
static inline void pci_release_of_node(struct pci_dev *dev) { } static inline void pci_release_of_node(struct pci_dev *dev) { }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment