diff options
author | Niklas Cassel <niklas.cassel@axis.com> | 2018-01-19 04:39:06 -0500 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2018-01-19 12:37:45 -0500 |
commit | 80db6f08b7af93eddc9487535e6150b220262637 (patch) | |
tree | 99ff59277178b327210d58b691e6a1103864749e | |
parent | 7506dc7989933235e6fc23f3d0516bdbf0f7d1a8 (diff) |
PCI: Add dummy pci_irqd_intx_xlate() for CONFIG_PCI=n build
Some hardware can operate in either "host" or "endpoint" mode, which means
there can be both a host bridge driver and an endpoint driver for the same
device. Those drivers share a lot of code, so sometimes they live in the
same source file.
The host bridge driver requires CONFIG_PCI=y because it enumerates PCI
devices below the bridge using the PCI core. The endpoint driver does not
require CONFIG_PCI=y because it runs in an embedded kernel on the other
side of the device, e.g., on an adapter card.
pci-dra7xx.c contains both host and endpoint drivers. If we select only
the endpoint driver (CONFIG_PCI=n and CONFIG_PCI_DRA7XX_EP=y), the unneeded
host driver is still compiled. It references pci_irqd_intx_xlate(), which
is not present when CONFIG_PCI=n, which causes this error:
drivers/pci/dwc/pci-dra7xx.c:229:11: error: 'pci_irqd_intx_xlate' undeclared here (not in a function)
Add a dummy pci_irqd_intx_xlate() for the CONFIG_PCI=n case.
[bhelgaas: changelog]
Signed-off-by: Niklas Cassel <niklas.cassel@axis.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
-rw-r--r-- | include/linux/pci.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/linux/pci.h b/include/linux/pci.h index 6079ab46191f..febe7f653689 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h | |||
@@ -1686,6 +1686,13 @@ static inline int pci_get_new_domain_nr(void) { return -ENOSYS; } | |||
1686 | #define dev_is_pf(d) (false) | 1686 | #define dev_is_pf(d) (false) |
1687 | static inline bool pci_acs_enabled(struct pci_dev *pdev, u16 acs_flags) | 1687 | static inline bool pci_acs_enabled(struct pci_dev *pdev, u16 acs_flags) |
1688 | { return false; } | 1688 | { return false; } |
1689 | static inline int pci_irqd_intx_xlate(struct irq_domain *d, | ||
1690 | struct device_node *node, | ||
1691 | const u32 *intspec, | ||
1692 | unsigned int intsize, | ||
1693 | unsigned long *out_hwirq, | ||
1694 | unsigned int *out_type) | ||
1695 | { return -EINVAL; } | ||
1689 | #endif /* CONFIG_PCI */ | 1696 | #endif /* CONFIG_PCI */ |
1690 | 1697 | ||
1691 | /* Include architecture-dependent settings and functions */ | 1698 | /* Include architecture-dependent settings and functions */ |