of_pci.h (915B)
1/* SPDX-License-Identifier: GPL-2.0 */ 2#ifndef __OF_PCI_H 3#define __OF_PCI_H 4 5#include <linux/types.h> 6#include <linux/errno.h> 7 8struct pci_dev; 9struct device_node; 10 11#if IS_ENABLED(CONFIG_OF) && IS_ENABLED(CONFIG_PCI) 12struct device_node *of_pci_find_child_device(struct device_node *parent, 13 unsigned int devfn); 14int of_pci_get_devfn(struct device_node *np); 15void of_pci_check_probe_only(void); 16#else 17static inline struct device_node *of_pci_find_child_device(struct device_node *parent, 18 unsigned int devfn) 19{ 20 return NULL; 21} 22 23static inline int of_pci_get_devfn(struct device_node *np) 24{ 25 return -EINVAL; 26} 27 28static inline void of_pci_check_probe_only(void) { } 29#endif 30 31#if IS_ENABLED(CONFIG_OF_IRQ) 32int of_irq_parse_and_map_pci(const struct pci_dev *dev, u8 slot, u8 pin); 33#else 34static inline int 35of_irq_parse_and_map_pci(const struct pci_dev *dev, u8 slot, u8 pin) 36{ 37 return 0; 38} 39#endif 40 41#endif