PCI: Always define the of_node helpers
Simply move these inline functions outside the ifdef instead of duplicating them as stubs in the !OF case. The struct device of_node field does not depend on OF. This also fixes the missing stubbed pci_bus_to_OF_node(). Signed-off-by: Bjørn Mork <bjorn@mork.no> Signed-off-by: Bjorn Helgaas <helgaas@kernel.org>hifive-unleashed-5.1
parent
df62ab5e0f
commit
ad32eb2df8
|
@ -2182,6 +2182,21 @@ int pci_parse_request_of_pci_ranges(struct device *dev,
|
||||||
/* Arch may override this (weak) */
|
/* Arch may override this (weak) */
|
||||||
struct device_node *pcibios_get_phb_of_node(struct pci_bus *bus);
|
struct device_node *pcibios_get_phb_of_node(struct pci_bus *bus);
|
||||||
|
|
||||||
|
#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) { }
|
||||||
|
static inline void pci_set_bus_of_node(struct pci_bus *bus) { }
|
||||||
|
static inline void pci_release_bus_of_node(struct pci_bus *bus) { }
|
||||||
|
static inline struct irq_domain *
|
||||||
|
pci_host_bridge_of_msi_domain(struct pci_bus *bus) { return NULL; }
|
||||||
|
static inline int pci_parse_request_of_pci_ranges(struct device *dev,
|
||||||
|
struct list_head *resources,
|
||||||
|
struct resource **bus_range)
|
||||||
|
{
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
|
#endif /* CONFIG_OF */
|
||||||
|
|
||||||
static inline struct device_node *
|
static inline struct device_node *
|
||||||
pci_device_to_OF_node(const struct pci_dev *pdev)
|
pci_device_to_OF_node(const struct pci_dev *pdev)
|
||||||
{
|
{
|
||||||
|
@ -2193,23 +2208,6 @@ static inline struct device_node *pci_bus_to_OF_node(struct pci_bus *bus)
|
||||||
return bus ? bus->dev.of_node : NULL;
|
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) { }
|
|
||||||
static inline void pci_set_bus_of_node(struct pci_bus *bus) { }
|
|
||||||
static inline void pci_release_bus_of_node(struct pci_bus *bus) { }
|
|
||||||
static inline struct device_node *
|
|
||||||
pci_device_to_OF_node(const struct pci_dev *pdev) { return NULL; }
|
|
||||||
static inline struct irq_domain *
|
|
||||||
pci_host_bridge_of_msi_domain(struct pci_bus *bus) { return NULL; }
|
|
||||||
static inline int pci_parse_request_of_pci_ranges(struct device *dev,
|
|
||||||
struct list_head *resources,
|
|
||||||
struct resource **bus_range)
|
|
||||||
{
|
|
||||||
return -EINVAL;
|
|
||||||
}
|
|
||||||
#endif /* CONFIG_OF */
|
|
||||||
|
|
||||||
#ifdef CONFIG_ACPI
|
#ifdef CONFIG_ACPI
|
||||||
struct irq_domain *pci_host_bridge_acpi_msi_domain(struct pci_bus *bus);
|
struct irq_domain *pci_host_bridge_acpi_msi_domain(struct pci_bus *bus);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue