From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-bl2nam02on0136.outbound.protection.outlook.com ([104.47.38.136]:51875 "EHLO NAM02-BL2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753239AbeDIAR6 (ORCPT ); Sun, 8 Apr 2018 20:17:58 -0400 From: Sasha Levin To: "stable@vger.kernel.org" , "linux-kernel@vger.kernel.org" CC: Niklas Cassel , Bjorn Helgaas , Sasha Levin Subject: [PATCH AUTOSEL for 4.15 050/189] PCI: Add dummy pci_irqd_intx_xlate() for CONFIG_PCI=n build Date: Mon, 9 Apr 2018 00:17:25 +0000 Message-ID: <20180409001637.162453-50-alexander.levin@microsoft.com> References: <20180409001637.162453-1-alexander.levin@microsoft.com> In-Reply-To: <20180409001637.162453-1-alexander.levin@microsoft.com> Content-Language: en-US Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org List-ID: From: Niklas Cassel [ Upstream commit 80db6f08b7af93eddc9487535e6150b220262637 ] 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=3Dy because it enumerates PCI devices below the bridge using the PCI core. The endpoint driver does not require CONFIG_PCI=3Dy 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=3Dn and CONFIG_PCI_DRA7XX_EP=3Dy), the unne= eded host driver is still compiled. It references pci_irqd_intx_xlate(), which is not present when CONFIG_PCI=3Dn, which causes this error: drivers/pci/dwc/pci-dra7xx.c:229:11: error: 'pci_irqd_intx_xlate' undecla= red here (not in a function) Add a dummy pci_irqd_intx_xlate() for the CONFIG_PCI=3Dn case. [bhelgaas: changelog] Signed-off-by: Niklas Cassel Signed-off-by: Bjorn Helgaas Acked-by: Arnd Bergmann Acked-by: Lorenzo Pieralisi Signed-off-by: Sasha Levin --- include/linux/pci.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/include/linux/pci.h b/include/linux/pci.h index c170c9250c8b..f69944699317 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h @@ -1686,6 +1686,13 @@ static inline int pci_get_new_domain_nr(void) { retu= rn -ENOSYS; } #define dev_is_pf(d) (false) static inline bool pci_acs_enabled(struct pci_dev *pdev, u16 acs_flags) { return false; } +static inline int pci_irqd_intx_xlate(struct irq_domain *d, + struct device_node *node, + const u32 *intspec, + unsigned int intsize, + unsigned long *out_hwirq, + unsigned int *out_type) +{ return -EINVAL; } #endif /* CONFIG_PCI */ =20 /* Include architecture-dependent settings and functions */ --=20 2.15.1