From patchwork Wed Dec 16 04:34:59 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guenter Roeck X-Patchwork-Id: 7859911 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 95E99BEEE1 for ; Wed, 16 Dec 2015 04:37:27 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C13B52035E for ; Wed, 16 Dec 2015 04:37:26 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D93B12034C for ; Wed, 16 Dec 2015 04:37:25 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1a93oE-0004Jv-9q; Wed, 16 Dec 2015 04:35:26 +0000 Received: from bh-25.webhostbox.net ([208.91.199.152]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1a93oB-0003NV-HN for linux-arm-kernel@lists.infradead.org; Wed, 16 Dec 2015 04:35:24 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=roeck-us.net; s=default; h=Message-Id:Date:Subject:Cc:To:From; bh=mSjltluRlD+g+0g512sLTLD+OnRTxDdvdpOvjMQCCqc=; b=vCFcxXmBPZiYF+SwfZanVotmfE F2B/wCjw6Vgd1/BAnCWsU79wSF1Wl8HeiUg620wuFqWWU33lD6f5tNFndTRoMQ/SykPksLSaQFWzF wL/OD5tQSIUL5NDsxsPEoTyLn6oa48NiMBEQjUdmEUEa8zIV6Jtf4K1tH+k6MFQ0kR7I=; Received: from 108-223-40-66.lightspeed.sntcca.sbcglobal.net ([108.223.40.66]:58235 helo=localhost) by bh-25.webhostbox.net with esmtpa (Exim 4.86) (envelope-from ) id 1a93no-002JOv-EL; Wed, 16 Dec 2015 04:35:01 +0000 From: Guenter Roeck To: Rob Herring Subject: [PATCH -next] of: Move of_io_request_and_map prototype to correct context Date: Tue, 15 Dec 2015 20:34:59 -0800 Message-Id: <1450240499-17474-1-git-send-email-linux@roeck-us.net> X-Mailer: git-send-email 2.1.4 X-Authenticated_sender: guenter@roeck-us.net X-OutGoing-Spam-Status: No, score=-1.0 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - bh-25.webhostbox.net X-AntiAbuse: Original Domain - lists.infradead.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - roeck-us.net X-Get-Message-Sender-Via: bh-25.webhostbox.net: authenticated_id: guenter@roeck-us.net X-Authenticated-Sender: bh-25.webhostbox.net: guenter@roeck-us.net X-Source: X-Source-Args: X-Source-Dir: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20151215_203523_657082_7BB3BA44 X-CRM114-Status: UNSURE ( 9.76 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.0 (--) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, Daniel Lezcano , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Frank Rowand , Guenter Roeck MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED, T_DKIM_INVALID, T_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 of_io_request_and_map() is defined in of/address.c, which is compiled if CONFIG_OF_ADDRESS is configured. However, it is defined in the context of CONFIG_OF. This results in the following build errors for sparc:allmodconfig (which defines CONFIG_OF but not CONFIG_OF_ADDRESS). drivers/built-in.o: In function `meson6_timer_init': meson6_timer.c:(.init.text+0x62a8): undefined reference to `of_io_request_and_map' drivers/built-in.o: In function `mtk_timer_init': mtk_timer.c:(.init.text+0x6e70): undefined reference to `of_io_request_and_map' drivers/built-in.o: In function `asm9260_timer_init': asm9260_timer.c:(.init.text+0x6fcc): undefined reference to `of_io_request_and_map' Move function prototype and dummy function into the CONFIG_OF_ADDRESS conditional to fix the problem. Exposed by commit bec8c4617611 ("clocksource/drivers/mediatek: Add the COMPILE_TEST option"). Cc: Daniel Lezcano Signed-off-by: Guenter Roeck --- include/linux/of_address.h | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/include/linux/of_address.h b/include/linux/of_address.h index 507daad0bc8d..b5324c0553bd 100644 --- a/include/linux/of_address.h +++ b/include/linux/of_address.h @@ -56,6 +56,8 @@ extern struct of_pci_range *of_pci_range_parser_one( extern int of_dma_get_range(struct device_node *np, u64 *dma_addr, u64 *paddr, u64 *size); extern bool of_dma_is_coherent(struct device_node *np); +void __iomem *of_io_request_and_map(struct device_node *device, + int index, const char *name); #else /* CONFIG_OF_ADDRESS */ static inline u64 of_translate_address(struct device_node *np, @@ -106,18 +108,22 @@ static inline bool of_dma_is_coherent(struct device_node *np) { return false; } + +#include + +static inline void __iomem *of_io_request_and_map(struct device_node *device, + int index, const char *name) +{ + return IOMEM_ERR_PTR(-EINVAL); +} #endif /* CONFIG_OF_ADDRESS */ #ifdef CONFIG_OF extern int of_address_to_resource(struct device_node *dev, int index, struct resource *r); void __iomem *of_iomap(struct device_node *node, int index); -void __iomem *of_io_request_and_map(struct device_node *device, - int index, const char *name); #else -#include - static inline int of_address_to_resource(struct device_node *dev, int index, struct resource *r) { @@ -129,11 +135,6 @@ static inline void __iomem *of_iomap(struct device_node *device, int index) return NULL; } -static inline void __iomem *of_io_request_and_map(struct device_node *device, - int index, const char *name) -{ - return IOMEM_ERR_PTR(-EINVAL); -} #endif #if defined(CONFIG_OF_ADDRESS) && defined(CONFIG_PCI)