diff options
author | Rob Herring <robh@kernel.org> | 2018-05-11 19:15:30 +0200 |
---|---|---|
committer | Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> | 2018-05-14 19:09:40 +0200 |
commit | 9e2aee80c78d5084e0c58745e9762c29da6bd53f (patch) | |
tree | 52ce23d15b27a896b1159fc09a1cd7405c2c3daa /drivers/pci/pci.h | |
parent | PCI: dwc: Move CONFIG_PCI depends to menu (diff) | |
download | linux-9e2aee80c78d5084e0c58745e9762c29da6bd53f.tar.xz linux-9e2aee80c78d5084e0c58745e9762c29da6bd53f.zip |
PCI: Move private DT related functions into private header
The functions in linux/of_pci.h are primarily used by host bridge
drivers, so they can be private to drivers/pci/.
The remaining functions are still used mostly in host bridge drivers
that still live in arch specific code. Hopefully someday, those will get
moved into drivers/pci as well.
Signed-off-by: Rob Herring <robh@kernel.org>
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Jingoo Han <jingoohan1@gmail.com>
Diffstat (limited to 'drivers/pci/pci.h')
-rw-r--r-- | drivers/pci/pci.h | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/drivers/pci/pci.h b/drivers/pci/pci.h index 023f7cf25bff..6c7cd16a1d1c 100644 --- a/drivers/pci/pci.h +++ b/drivers/pci/pci.h @@ -407,4 +407,44 @@ static inline u64 pci_rebar_size_to_bytes(int size) return 1ULL << (size + 20); } +struct device_node; + +#ifdef CONFIG_OF +int of_pci_parse_bus_range(struct device_node *node, struct resource *res); +int of_get_pci_domain_nr(struct device_node *node); +int of_pci_get_max_link_speed(struct device_node *node); + +#else +static inline int +of_pci_parse_bus_range(struct device_node *node, struct resource *res) +{ + return -EINVAL; +} + +static inline int +of_get_pci_domain_nr(struct device_node *node) +{ + return -1; +} + +static inline int +of_pci_get_max_link_speed(struct device_node *node) +{ + return -EINVAL; +} +#endif /* CONFIG_OF */ + +#if defined(CONFIG_OF_ADDRESS) +int of_pci_get_host_bridge_resources(struct device_node *dev, + unsigned char busno, unsigned char bus_max, + struct list_head *resources, resource_size_t *io_base); +#else +static inline int of_pci_get_host_bridge_resources(struct device_node *dev, + unsigned char busno, unsigned char bus_max, + struct list_head *resources, resource_size_t *io_base) +{ + return -EINVAL; +} +#endif + #endif /* DRIVERS_PCI_H */ |