From patchwork Mon Jun 17 19:15:27 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 2737221 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 7708DC0AB1 for ; Mon, 17 Jun 2013 19:15:24 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 33EF420466 for ; Mon, 17 Jun 2013 19:15:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 54AF92045C for ; Mon, 17 Jun 2013 19:15:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752042Ab3FQTPV (ORCPT ); Mon, 17 Jun 2013 15:15:21 -0400 Received: from perceval.ideasonboard.com ([95.142.166.194]:51002 "EHLO perceval.ideasonboard.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751825Ab3FQTPU (ORCPT ); Mon, 17 Jun 2013 15:15:20 -0400 Received: from avalon.ideasonboard.com (130.4-200-80.adsl-dyn.isp.belgacom.be [80.200.4.130]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 0E69835A4F; Mon, 17 Jun 2013 21:15:12 +0200 (CEST) From: Laurent Pinchart To: linux-sh@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org, Linus Walleij Subject: [PATCH 2/2] gpio-rcar: Remove #ifdef CONFIG_OF around OF-specific sections Date: Mon, 17 Jun 2013 21:15:27 +0200 Message-Id: <1371496527-13149-3-git-send-email-laurent.pinchart+renesas@ideasonboard.com> X-Mailer: git-send-email 1.8.1.5 In-Reply-To: <1371496527-13149-1-git-send-email-laurent.pinchart+renesas@ideasonboard.com> References: <1371496527-13149-1-git-send-email-laurent.pinchart+renesas@ideasonboard.com> Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Spam-Status: No, score=-8.0 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 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_SELECTED(CONFIG_OF)) and let the compiler optimize the unused code away. Signed-off-by: Laurent Pinchart --- 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) {