From patchwork Thu Jun 20 13:09:11 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Horman X-Patchwork-Id: 2755951 Return-Path: X-Original-To: patchwork-linux-arm@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 3941E9F751 for ; Thu, 20 Jun 2013 13:44:32 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8911020202 for ; Thu, 20 Jun 2013 13:44:27 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4639C201FE for ; Thu, 20 Jun 2013 13:44:26 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Upedy-0005OH-Ts; Thu, 20 Jun 2013 13:11:20 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Uped1-0006Ur-Hz; Thu, 20 Jun 2013 13:10:19 +0000 Received: from kirsty.vergenet.net ([202.4.237.240]) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UpecJ-0006RC-DF for linux-arm-kernel@lists.infradead.org; Thu, 20 Jun 2013 13:09:40 +0000 Received: from ayumi.isobedori.kobe.vergenet.net (p5212-ipbfp1903kobeminato.hyogo.ocn.ne.jp [114.172.132.212]) by kirsty.vergenet.net (Postfix) with ESMTP id 804EF266CED; Thu, 20 Jun 2013 23:09:14 +1000 (EST) Received: by ayumi.isobedori.kobe.vergenet.net (Postfix, from userid 7100) id 1ABE0EDE7CD; Thu, 20 Jun 2013 22:09:13 +0900 (JST) From: Simon Horman To: Arnd Bergmann , Olof Johansson Subject: [PATCH 2/2] gpio-rcar: Remove #ifdef CONFIG_OF around OF-specific sections Date: Thu, 20 Jun 2013 22:09:11 +0900 Message-Id: <1371733751-27730-3-git-send-email-horms+renesas@verge.net.au> X-Mailer: git-send-email 1.8.2.1 In-Reply-To: <1371733751-27730-1-git-send-email-horms+renesas@verge.net.au> References: <1371733751-27730-1-git-send-email-horms+renesas@verge.net.au> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130620_090936_114974_A415D68C X-CRM114-Status: GOOD ( 12.89 ) X-Spam-Score: -3.9 (---) Cc: Laurent Pinchart , linux-sh@vger.kernel.org, Magnus Damm , arm@kernel.org, Simon Horman , linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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=-5.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, 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 From: Laurent Pinchart All functions and data types used by OF-specific code paths are declared in regardless of CONFIG_OF. Replace the #ifdef CONFIG_OF guard with a if(IS_ENABLED(CONFIG_OF)) and let the compiler optimize the unused code away. Signed-off-by: Laurent Pinchart Signed-off-by: Simon Horman --- drivers/gpio/gpio-rcar.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/gpio/gpio-rcar.c b/drivers/gpio/gpio-rcar.c index 5a693dd..7fd09ef 100644 --- a/drivers/gpio/gpio-rcar.c +++ b/drivers/gpio/gpio-rcar.c @@ -279,16 +279,13 @@ static struct irq_domain_ops gpio_rcar_irq_domain_ops = { static void gpio_rcar_parse_pdata(struct gpio_rcar_priv *p) { struct gpio_rcar_config *pdata = p->pdev->dev.platform_data; -#ifdef CONFIG_OF struct device_node *np = p->pdev->dev.of_node; struct of_phandle_args args; int ret; -#endif - if (pdata) + if (pdata) { p->config = *pdata; -#ifdef CONFIG_OF - else if (np) { + } else if (IS_ENABLED(CONFIG_OF) && np) { ret = of_parse_phandle_with_args(np, "gpio-ranges", "#gpio-range-cells", 0, &args); p->config.number_of_pins = ret == 0 && args.args_count == 3 @@ -296,7 +293,6 @@ static void gpio_rcar_parse_pdata(struct gpio_rcar_priv *p) : RCAR_MAX_GPIO_PER_BANK; p->config.gpio_base = -1; } -#endif if (p->config.number_of_pins == 0 || p->config.number_of_pins > RCAR_MAX_GPIO_PER_BANK) {