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: 881819 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-pci-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=roeck-us.net Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="SkbKAYJT"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3zwGCt3tdBz9sgZ for ; Tue, 6 Mar 2018 10:22:50 +1100 (AEDT) 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 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,