From patchwork Fri May 9 06:58:37 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 4140411 Return-Path: X-Original-To: patchwork-linux-sh@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 79706BFF02 for ; Fri, 9 May 2014 06:58:58 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A68EA202DD for ; Fri, 9 May 2014 06:58:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id EC5F22026C for ; Fri, 9 May 2014 06:58:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754438AbaEIG6w (ORCPT ); Fri, 9 May 2014 02:58:52 -0400 Received: from mout.kundenserver.de ([212.227.17.13]:59043 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754086AbaEIG6u (ORCPT ); Fri, 9 May 2014 02:58:50 -0400 Received: from wuerfel.localnet (HSI-KBW-134-3-133-35.hsi14.kabel-badenwuerttemberg.de [134.3.133.35]) by mrelayeu.kundenserver.de (node=mreue105) with ESMTP (Nemesis) id 0Lucts-1WrUS61Zku-00zrvN; Fri, 09 May 2014 08:58:38 +0200 From: Arnd Bergmann To: devicetree@vger.kernel.org Cc: Grant Likely , Rob Herring , Bjorn Helgaas , Magnus Damm , Geert Uytterhoeven , Ben Dooks , linux-pci@vger.kernel.org, linux-sh@vger.kernel.org Subject: [PATCH] of/irq: provide int of_irq_parse_and_map_pci wrapper Date: Fri, 09 May 2014 08:58:37 +0200 Message-ID: <4527717.yJh2gX3xCP@wuerfel> User-Agent: KMail/4.11.5 (Linux/3.11.0-18-generic; KDE/4.11.5; x86_64; ; ) MIME-Version: 1.0 X-Provags-ID: V02:K0:G6PZia0ooFUQzZhPs3A1Tnav5RNrhRL/qicu6gPW8wJ tsg60zFSPF2b7D896iVUtDnj+eu0fm+jvcneIatxQeKaTcsh0s JKGX9Y/XBYUPH3nSWJYmZipns0oyEtzXQKn9TCHxVLhMT12JdR BRtZ0SVykbrrwyP3kgiq8ZOA59dVfU41MJyjbxx2nTXSlykSYI w2c2jntvrqJTmyRVYsoDNYknCFUvKqn7rb1kZnTMQVSnyU6WGK q4f7VBYYIHOq9Vve9d9XdBwNOp7gGDiAHACpbJorBmCxq51BsR MdYPyivtm/B4r5JqXgkqC2JKjoEwaqcDSrk2hWqDxHAXmfTylO Zo62sXZGDQkLjEqQqsY4= Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The pci-rcar driver is enabled for compile tests, and this has now shown that the driver cannot build without CONFIG_OF, following the inclusion of f8f2fe7355fb "PCI: rcar: Use new OF interrupt mapping when possible": drivers/built-in.o: In function `rcar_pci_map_irq': :(.text+0x1cc7c): undefined reference to `of_irq_parse_and_map_pci' As pointed out by Ben Dooks and Geert Uytterhoeven, this is actually supposed to build fine, which we can achieve if we make the declaration of of_irq_parse_and_map_pci conditional on CONFIG_OF and provide an empty inline function otherwise, as we do for a lot of other of interfaces. This lets us build the rcar_pci driver again without CONFIG_OF, which won't work but give us compile time coverage. Signed-off-by: Arnd Bergmann Cc: Bjorn Helgaas Cc: Magnus Damm Cc: Geert Uytterhoeven Cc: Ben Dooks Cc: linux-pci@vger.kernel.org Cc: linux-sh@vger.kernel.org Acked-by: Geert Uytterhoeven --- To unsubscribe from this list: send the line "unsubscribe linux-sh" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/include/linux/of_pci.h b/include/linux/of_pci.h index 1a1f5ff..1e29bf4 100644 --- a/include/linux/of_pci.h +++ b/include/linux/of_pci.h @@ -7,13 +7,18 @@ struct pci_dev; struct of_phandle_args; int of_irq_parse_pci(const struct pci_dev *pdev, struct of_phandle_args *out_irq); -int of_irq_parse_and_map_pci(const struct pci_dev *dev, u8 slot, u8 pin); 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_pci_parse_bus_range(struct device_node *node, struct resource *res); +#ifdef CONFIG_OF +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) && defined(CONFIG_PCI_MSI) int of_pci_msi_chip_add(struct msi_chip *chip);