From patchwork Mon Mar 5 23:22:30 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guenter Roeck X-Patchwork-Id: 10260267 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 3F73360134 for ; Mon, 5 Mar 2018 23:22:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 34400289A6 for ; Mon, 5 Mar 2018 23:22:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2920B289BC; Mon, 5 Mar 2018 23:22:50 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D508C289A6 for ; Mon, 5 Mar 2018 23:22:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932784AbeCEXWf (ORCPT ); Mon, 5 Mar 2018 18:22:35 -0500 Received: from mail-pl0-f66.google.com ([209.85.160.66]:46798 "EHLO mail-pl0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932106AbeCEXWd (ORCPT ); Mon, 5 Mar 2018 18:22:33 -0500 Received: by mail-pl0-f66.google.com with SMTP id y8-v6so10682108pll.13; Mon, 05 Mar 2018 15:22:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id; bh=XdBbXzoBzM1VeO4VkAZMH45nj5RT74c70oYjsj0uMOk=; b=SkbKAYJTRZHznabkwdKte7R0jmC5GTINxSIGcAlQcGIINldQ3phLH+lbFSeIhAfCfd sZgieKRBOTtVUYeovBHNxadUjOmcrfSnK1G8jDPQmJd3Oehd7kK3V13kaoS8a8YFaArH urqwSlsgpyycEevHr7wvWZRiWK+SKruQw7ymbrE5rHIzl3aoF2U8AQmFBoAT4iBLy1pI OwGCCRYJnWisVkhE5kt91ePnbclvXRSJC46SpLc8g/DrAM1eqBNfcP7xMkr7Sgka9e5h JT3OhmcZ/HxzPe4MtcLVzdNoPGUqk4XTCNts4dQ2BaAp24tZylwmZkxUzAqLnkgfEiMx miwA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id; bh=XdBbXzoBzM1VeO4VkAZMH45nj5RT74c70oYjsj0uMOk=; b=nAZ1CEMHha7ntWgdSq0V+Rn58xti4N3IS3DCVG0m3HVMfGUqHRxcfJW4aeW2ClgY0A TZ0bCgBhtBuOdsunswZGI16i8wMXnEQoehPjAUs8yjDGHmWypst4wcQrEu5aqTpTB982 Wqq199+UmYxicxZHfSyiFylKK/QL9eU9OecjrZe7ItLFnzwiPgArpJJHS5SnVethwXw0 jeGZrvVAzqUkXHzcSh675b3O/3SyRtceUuJjYi1lh1uiRxfwpXGomeOdK6/vRJRpi4Qa Lonn26S8jBkBnHI2KDYgZ4oy+HDD94AGGBTLaw/iwhZh4f2GblwxUEo6WZ5P/iRNCiLZ KWZA== X-Gm-Message-State: APf1xPA+V52HHeOI5rouv4lw//2O2hui8Ct+RzYGa+OSdruX2J4Ui4WV JQKMFxaGgyAYZerUBpkZhs1Z6U5z X-Google-Smtp-Source: AG47ELvpxzBEMXtyRiLX22cZc0Gqh8U2NbD/VLzVt/ds8Lf4gHaDkQv3vu7CUpxY/zQrifL1Tz6vdA== X-Received: by 2002:a17:902:d204:: with SMTP id t4-v6mr14931440ply.377.1520292153271; Mon, 05 Mar 2018 15:22:33 -0800 (PST) Received: from localhost (108-223-40-66.lightspeed.sntcca.sbcglobal.net. [108.223.40.66]) by smtp.gmail.com with ESMTPSA id o10sm22101360pgf.25.2018.03.05.15.22.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 05 Mar 2018 15:22:32 -0800 (PST) From: Guenter Roeck To: Rob Herring , Bjorn Helgaas Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, Guenter Roeck , Rob Herring Subject: [PATCH v2] PCI: Move declaration of of_irq_parse_and_map_pci under OF_IRQ Date: Mon, 5 Mar 2018 15:22:30 -0800 Message-Id: <1520292150-15699-1-git-send-email-linux@roeck-us.net> X-Mailer: git-send-email 2.7.4 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Since commit 4670d610d5923 ("PCI: Move OF-related PCI functions into PCI core"), sparc:allmodconfig fails to build with the following error. pcie-cadence-host.c:(.text+0x4c4): undefined reference to `of_irq_parse_and_map_pci' pcie-cadence-host.c:(.text+0x4c8): undefined reference to `of_irq_parse_and_map_pci' of_irq_parse_and_map_pci is now only available if OF_IRQ is enabled. Make its declaration and its dummy function dependent on OF_IRQ to solve the problem. Fixes: 4670d610d5923 ("PCI: Move OF-related PCI functions into PCI core") Cc: Rob Herring Acked-by: Rob Herring Signed-off-by: Guenter Roeck --- v2: Added Rob's Ack Sent to linux-pci mailing list per Rob's request include/linux/of_pci.h | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/include/linux/of_pci.h b/include/linux/of_pci.h index 88865e0ebf4d..091033a6b836 100644 --- a/include/linux/of_pci.h +++ b/include/linux/of_pci.h @@ -13,7 +13,6 @@ struct device_node; struct device_node *of_pci_find_child_device(struct device_node *parent, unsigned int devfn); int of_pci_get_devfn(struct device_node *np); -int of_irq_parse_and_map_pci(const struct pci_dev *dev, u8 slot, u8 pin); int of_pci_parse_bus_range(struct device_node *node, struct resource *res); int of_get_pci_domain_nr(struct device_node *node); int of_pci_get_max_link_speed(struct device_node *node); @@ -34,12 +33,6 @@ static inline int of_pci_get_devfn(struct device_node *np) } static inline int -of_irq_parse_and_map_pci(const struct pci_dev *dev, u8 slot, u8 pin) -{ - return 0; -} - -static inline int of_pci_parse_bus_range(struct device_node *node, struct resource *res) { return -EINVAL; @@ -67,6 +60,16 @@ of_pci_get_max_link_speed(struct device_node *node) static inline void of_pci_check_probe_only(void) { } #endif +#if IS_ENABLED(CONFIG_OF_IRQ) +int of_irq_parse_and_map_pci(const struct pci_dev *dev, u8 slot, u8 pin); +#else +static inline int +of_irq_parse_and_map_pci(const struct pci_dev *dev, u8 slot, u8 pin) +{ + return 0; +} +#endif + #if defined(CONFIG_OF_ADDRESS) int of_pci_get_host_bridge_resources(struct device_node *dev, unsigned char busno, unsigned char bus_max,