From patchwork Fri Jul 4 20:24:06 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Javier Martinez Canillas X-Patchwork-Id: 4483461 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.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id B4D0FBEEAA for ; Fri, 4 Jul 2014 20:27:37 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8EE4920381 for ; Fri, 4 Jul 2014 20:27:36 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7191E20265 for ; Fri, 4 Jul 2014 20:27:35 +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 1X3A3A-0005hx-K3; Fri, 04 Jul 2014 20:25:40 +0000 Received: from bhuna.collabora.co.uk ([93.93.135.160]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1X3A2u-0005Sb-P7 for linux-arm-kernel@lists.infradead.org; Fri, 04 Jul 2014 20:25:25 +0000 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: javier) with ESMTPSA id 3AE6B60276E From: Javier Martinez Canillas To: Lee Jones Subject: [PATCH v7 03/24] mfd: max77686: Don't define dummy function if OF isn't enabled Date: Fri, 4 Jul 2014 22:24:06 +0200 Message-Id: <1404505467-26526-4-git-send-email-javier.martinez@collabora.co.uk> X-Mailer: git-send-email 2.0.0.rc2 In-Reply-To: <1404505467-26526-1-git-send-email-javier.martinez@collabora.co.uk> References: <1404505467-26526-1-git-send-email-javier.martinez@collabora.co.uk> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140704_132524_968599_DE5A41F8 X-CRM114-Status: GOOD ( 11.04 ) X-Spam-Score: -0.0 (/) Cc: Alessandro Zummo , Krzysztof Kozlowski , Kukjin Kim , Mike Turquette , Tomeu Vizoso , devicetree@vger.kernel.org, Yadwinder Singh Brar , linux-kernel@vger.kernel.org, Liam Girdwood , Javier Martinez Canillas , Doug Anderson , Tushar Behera , Mark Brown , linux-samsung-soc@vger.kernel.org, Olof Johansson , Andreas Farber , linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 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=-1.9 required=5.0 tests=BAYES_00, 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 When the CONFIG_OF option was not enabled, a dummy function max77686_i2c_parse_dt_pdata() was defined since this is called unconditionally on probe(). Just always define the real function and conditionally call it if CONFIG_OF is enabled instead. Signed-off-by: Javier Martinez Canillas Acked-by: Lee Jones --- drivers/mfd/max77686.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/drivers/mfd/max77686.c b/drivers/mfd/max77686.c index a38e9ee..d1f9d04 100644 --- a/drivers/mfd/max77686.c +++ b/drivers/mfd/max77686.c @@ -96,7 +96,6 @@ static const struct regmap_irq_chip max77686_rtc_irq_chip = { .num_irqs = ARRAY_SIZE(max77686_rtc_irqs), }; -#ifdef CONFIG_OF static const struct of_device_id max77686_pmic_dt_match[] = { {.compatible = "maxim,max77686", .data = NULL}, {}, @@ -116,13 +115,6 @@ static struct max77686_platform_data *max77686_i2c_parse_dt_pdata(struct device dev->platform_data = pd; return pd; } -#else -static struct max77686_platform_data *max77686_i2c_parse_dt_pdata(struct device - *dev) -{ - return 0; -} -#endif static int max77686_i2c_probe(struct i2c_client *i2c, const struct i2c_device_id *id) @@ -132,7 +124,7 @@ static int max77686_i2c_probe(struct i2c_client *i2c, unsigned int data; int ret = 0; - if (i2c->dev.of_node) + if (IS_ENABLED(CONFIG_OF) && i2c->dev.of_node) pdata = max77686_i2c_parse_dt_pdata(&i2c->dev); if (!pdata) {