Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux
[linux-2.6-block.git] / include / linux / of_pci.h
CommitLineData
b2441318 1/* SPDX-License-Identifier: GPL-2.0 */
04bea68b
SAS
2#ifndef __OF_PCI_H
3#define __OF_PCI_H
4
bbd8810d
KW
5#include <linux/types.h>
6#include <linux/errno.h>
04bea68b
SAS
7
8struct pci_dev;
98d9f30c 9struct device_node;
64c5c759 10
4670d610 11#if IS_ENABLED(CONFIG_OF) && IS_ENABLED(CONFIG_PCI)
98d9f30c
BH
12struct device_node *of_pci_find_child_device(struct device_node *parent,
13 unsigned int devfn);
45ab9702 14int of_pci_get_devfn(struct device_node *np);
f81c11af 15void of_pci_check_probe_only(void);
64c5c759 16#else
64c5c759
AB
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
f81c11af 28static inline void of_pci_check_probe_only(void) { }
64c5c759 29#endif
98d9f30c 30
a6f1086e
GR
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
04bea68b 41#endif