aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/pci.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/pci.h')
-rw-r--r--include/linux/pci.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/include/linux/pci.h b/include/linux/pci.h
index c446b5ca2d38..2d292182dde5 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -1589,5 +1589,33 @@ int pci_vpd_find_tag(const u8 *buf, unsigned int off, unsigned int len, u8 rdt);
1589int pci_vpd_find_info_keyword(const u8 *buf, unsigned int off, 1589int pci_vpd_find_info_keyword(const u8 *buf, unsigned int off,
1590 unsigned int len, const char *kw); 1590 unsigned int len, const char *kw);
1591 1591
1592/* PCI <-> OF binding helpers */
1593#ifdef CONFIG_OF
1594struct device_node;
1595extern void pci_set_of_node(struct pci_dev *dev);
1596extern void pci_release_of_node(struct pci_dev *dev);
1597extern void pci_set_bus_of_node(struct pci_bus *bus);
1598extern void pci_release_bus_of_node(struct pci_bus *bus);
1599
1600/* Arch may override this (weak) */
1601extern struct device_node * __weak pcibios_get_phb_of_node(struct pci_bus *bus);
1602
1603static inline struct device_node *pci_device_to_OF_node(struct pci_dev *pdev)
1604{
1605 return pdev ? pdev->dev.of_node : NULL;
1606}
1607
1608static inline struct device_node *pci_bus_to_OF_node(struct pci_bus *bus)
1609{
1610 return bus ? bus->dev.of_node : NULL;
1611}
1612
1613#else /* CONFIG_OF */
1614static inline void pci_set_of_node(struct pci_dev *dev) { }
1615static inline void pci_release_of_node(struct pci_dev *dev) { }
1616static inline void pci_set_bus_of_node(struct pci_bus *bus) { }
1617static inline void pci_release_bus_of_node(struct pci_bus *bus) { }
1618#endif /* CONFIG_OF */
1619
1592#endif /* __KERNEL__ */ 1620#endif /* __KERNEL__ */
1593#endif /* LINUX_PCI_H */ 1621#endif /* LINUX_PCI_H */