From patchwork Fri May 9 09:03:11 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 4140981 Return-Path: X-Original-To: patchwork-linux-sh@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id BA16E9F387 for ; Fri, 9 May 2014 09:03:32 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id F299C2017A for ; Fri, 9 May 2014 09:03:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 237BF2015D for ; Fri, 9 May 2014 09:03:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752270AbaEIJDa (ORCPT ); Fri, 9 May 2014 05:03:30 -0400 Received: from mout.kundenserver.de ([212.227.126.131]:61073 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751055AbaEIJD3 (ORCPT ); Fri, 9 May 2014 05:03:29 -0400 Received: from wuerfel.localnet (HSI-KBW-134-3-133-35.hsi14.kabel-badenwuerttemberg.de [134.3.133.35]) by mrelayeu.kundenserver.de (node=mreue005) with ESMTP (Nemesis) id 0LfFgy-1XB9mR3kXQ-00ojpq; Fri, 09 May 2014 11:03:12 +0200 From: Arnd Bergmann To: Lucas Stach Cc: devicetree@vger.kernel.org, Grant Likely , Rob Herring , Bjorn Helgaas , Magnus Damm , Geert Uytterhoeven , Ben Dooks , linux-pci@vger.kernel.org, linux-sh@vger.kernel.org Subject: [PATCH v2] of/irq: provide int of_irq_parse_and_map_pci wrapper Date: Fri, 09 May 2014 11:03:11 +0200 Message-ID: <5744457.bgUFy9g0ST@wuerfel> User-Agent: KMail/4.11.5 (Linux/3.11.0-18-generic; KDE/4.11.5; x86_64; ; ) In-Reply-To: <1399624119.4833.3.camel@weser.hi.pengutronix.de> References: <4527717.yJh2gX3xCP@wuerfel> <1399624119.4833.3.camel@weser.hi.pengutronix.de> MIME-Version: 1.0 X-Provags-ID: V02:K0:Xn01zDIGTlSG8t4y03nYG4fU8lezCEPPIfnolNJpvAY VoCi3xCMPokEYK+I/81q/jvHK7DARG1js/rjxQB7sWjh/q6aTM HywrTjx7C3y5TIf39rKi+N4jdCHDdFbyfWPcqH/qySQuZoYiFh Wt+03dRVg0fxE4ukZixtsvW5rs/6Oz0Bd/QPEDy03FxfcCj9yJ vMmpVc98W9v2NIFWTqljAyLJb26lgC6OlnLDdkfkFH/2NItUkY fSOF3GYQNv8KxkevSSmzuByeUvvjshgn3GiTo58lH/zbpwZQ0U FKqbYGyXQ0n4kkmwxahBLaBHfX/2qbguywZzciwqKLWoh5jtE4 VKqgwXG5qxb1O2Nlbs2Q= 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=unavailable 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 for build testing. All platforms using this driver select OF, so this doesn't change anything for the users. 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 Reviewed-by: Jingoo Han --- v2: clarified commit text. -- 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);