From patchwork Thu Mar 17 09:20:20 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 102556 Delivered-To: patch@linaro.org Received: by 10.112.199.169 with SMTP id jl9csp345585lbc; Thu, 17 Mar 2016 02:21:04 -0700 (PDT) X-Received: by 10.98.18.212 with SMTP id 81mr13328325pfs.104.1458206464575; Thu, 17 Mar 2016 02:21:04 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id gv5si11309360pac.54.2016.03.17.02.21.04; Thu, 17 Mar 2016 02:21:04 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934775AbcCQJUs (ORCPT + 1 other); Thu, 17 Mar 2016 05:20:48 -0400 Received: from mout.kundenserver.de ([212.227.126.131]:49494 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933251AbcCQJUn (ORCPT ); Thu, 17 Mar 2016 05:20:43 -0400 Received: from wuerfel.lan. ([78.42.132.4]) by mrelayeu.kundenserver.de (mreue001) with ESMTPA (Nemesis) id 0MOXED-1amEsA228j-005mCp; Thu, 17 Mar 2016 10:20:35 +0100 From: Arnd Bergmann To: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= Cc: Arnd Bergmann , Kalle Valo , Hauke Mehrtens , linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/2] bcma: fix building without OF_IRQ Date: Thu, 17 Mar 2016 10:20:20 +0100 Message-Id: <1458206432-3039552-1-git-send-email-arnd@arndb.de> X-Mailer: git-send-email 2.7.0 X-Provags-ID: V03:K0:ld0aLEoFrw7Dg8w4lZthRfL79SNJu23Pn5rLuEX0Pn0VkJkTnze wzEDMF0XYCtG/nm4k0y4segCMgnLZHMkbUmDJGkkOODVNnz0Ac2Ai01R1quxUS7cRiaaMTZ 5AUg9L/ZO8o2rnRSUkzMFa3za3BivTIgpbunPO4AGFzPOMB67Zim6NF0nbArKrUhnDetQDF 2n8GkWyNgc2u288hxgx/Q== X-UI-Out-Filterresults: notjunk:1; V01:K0:v7e4NHZHfLM=:OVD/zeAJZtwF5APOHiw3Gg XXYu8Gbdr4y99fZ0enl3woaC4Evy3qDBJAQqRAUUnZIfiTYSHac4ZlCsp4paukGOZCfa+JRyI ghEnyORiw84ZO3F+BcE7j0rfxAKbRF0hL1nIvFB4Q93XGNvo5hkl85Uts9og8jyX358nY4U+m xlddtbOLdpD8jS2lAM8MwmKRnv8Z9PY5anVFoXRnkWTasK28SLh+ZpEBC/j8yR+w1mbTk04Uc 8jIZiEAJd0PQ9ADuNXEBwLeHqBSWF3Dz0QD+SHoqK/sjTj2SpsNRE5YgBKwM5Fi1U2y47vAlf y5YRC5NKwPodN18teRrkdxchSsKx5PEh60k0/xvXbxF5DHjvPykjDfUmLbxijB8FldioUWVwf ollt3e/Z740LhKzlo2Q/6c9xaB9uVThlu614CIy5y8zQit7wVZ1ZuNYsWZFHXhOAOBOZG0OQB KyXpIVySY2BB6m0pJmJCzIWGpw0kEKkgvi6BTHtiK5xw9AMwgCSR7JJsavut68va6FoYwGpE6 mejxmYchvCNxdkWcTAjGkYkzokuMpzA1DVFThnapDlLaNqjAFrcKX7Y0zvpapBhmO4JkLnpDV /zA9f9SzGVrNqX+rWVAfXWLiONQB3n4cCO9z6iRlYCcjQel0T5ApO1pI6AaoLRKeQKWCxSrg0 gL9l5Ldp5mKmHzq1L+1e2WGCIMNqCXyx/tcHYB7E08AHoVfbCoQ9o065tGmOPoLu2/3I= Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org The bcma driver core can be built with or without DT support, but it fails to build when CONFIG_OF=y and CONFIG_OF_IRQ=n, which can happen on platforms that do not support IRQ domains. ERROR: "irq_create_of_mapping" [drivers/bcma/bcma.ko] undefined! ERROR: "of_irq_parse_raw" [drivers/bcma/bcma.ko] undefined! ERROR: "of_irq_parse_one" [drivers/bcma/bcma.ko] undefined! This adds another compile-time check for OF_IRQ, but also gets rid of now unneeded #ifdef checks: Using the simpler IS_ENABLED() check for OF_IRQ also covers the case of not having CONFIG_OF enabled. The check for CONFIG_OF_ADDRESS was added to allow building on architectures without OF_ADDRESS, but that has been addressed already in b1d06b60e90c ("of: Provide static inline function for of_translate_address if needed"). Signed-off-by: Arnd Bergmann --- drivers/bcma/main.c | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) -- 2.7.0 -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" 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/drivers/bcma/main.c b/drivers/bcma/main.c index 786be8fed39e..1f635471f318 100644 --- a/drivers/bcma/main.c +++ b/drivers/bcma/main.c @@ -136,7 +136,6 @@ static bool bcma_is_core_needed_early(u16 core_id) return false; } -#if defined(CONFIG_OF) && defined(CONFIG_OF_ADDRESS) static struct device_node *bcma_of_find_child_device(struct platform_device *parent, struct bcma_device *core) { @@ -184,7 +183,7 @@ static unsigned int bcma_of_get_irq(struct platform_device *parent, struct of_phandle_args out_irq; int ret; - if (!parent || !parent->dev.of_node) + if (!IS_ENABLED(CONFIG_OF_IRQ) || !parent || !parent->dev.of_node) return 0; ret = bcma_of_irq_parse(parent, core, &out_irq, num); @@ -202,23 +201,15 @@ static void bcma_of_fill_device(struct platform_device *parent, { struct device_node *node; + if (!IS_ENABLED(CONFIG_OF_IRQ)) + return; + node = bcma_of_find_child_device(parent, core); if (node) core->dev.of_node = node; core->irq = bcma_of_get_irq(parent, core, 0); } -#else -static void bcma_of_fill_device(struct platform_device *parent, - struct bcma_device *core) -{ -} -static inline unsigned int bcma_of_get_irq(struct platform_device *parent, - struct bcma_device *core, int num) -{ - return 0; -} -#endif /* CONFIG_OF */ unsigned int bcma_core_irq(struct bcma_device *core, int num) {