From patchwork Thu Feb 14 22:26:53 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 2143321 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork1.kernel.org (Postfix) with ESMTP id 4FEF13FCF6 for ; Thu, 14 Feb 2013 22:31:16 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1U67IL-000237-AM; Thu, 14 Feb 2013 22:28:45 +0000 Received: from moutng.kundenserver.de ([212.227.126.171]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1U67Gq-0001Vv-6D for linux-arm-kernel@lists.infradead.org; Thu, 14 Feb 2013 22:27:16 +0000 Received: from wuerfel.lan (HSI-KBW-46-223-90-92.hsi.kabel-badenwuerttemberg.de [46.223.90.92]) by mrelayeu.kundenserver.de (node=mreu1) with ESMTP (Nemesis) id 0Lgc09-1UiSHX0FEL-00nft1; Thu, 14 Feb 2013 23:27:06 +0100 From: Arnd Bergmann To: linux-arm-kernel@lists.infradead.org Subject: [PATCH 4/9] mfd: max8925: fix trivial build warning for non-dt Date: Thu, 14 Feb 2013 23:26:53 +0100 Message-Id: <1360880818-4071454-5-git-send-email-arnd@arndb.de> X-Mailer: git-send-email 1.8.1.2 In-Reply-To: <1360880818-4071454-1-git-send-email-arnd@arndb.de> References: <1360880818-4071454-1-git-send-email-arnd@arndb.de> X-Provags-ID: V02:K0:Xsz5trwr1E0CJo3Y83RZDqL6b+1JyoBaxnC+5TlK2Jn t7/Xp9Px3C8ZIPsWPjqF0+FeDvF1NLMNCEXg5dWC83dqPLz0xI 1vfwyuv8HOtFzChbPBIJcny2xMqjY5awdQ6EbNcUG9j1tHrZi6 mcF0nJjeHinQMqKXc2ug3/8abAazleo/1Cu9rARSBDAbWts3Kn JyXRagR0WYy9e8uMWhrZQW7DC0HUX9hiEM/ld4wx0r/QVorD7G XRzrb+STU0b4xuTTVJ/WBV1nJNQLWap9bI0Fn30UxqrewkomWN RWg1yxLBJv85EyDPNU0W0Dbyjw+emvtsmX6WX1N15RWq993WAT TFCnpyNdzNXfJ5iENVe25wJBhUVo+1gbsrSadBD3w X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130214_172712_514729_64524028 X-CRM114-Status: GOOD ( 13.71 ) X-Spam-Score: -1.9 (-) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-1.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [212.227.126.171 listed in list.dnswl.org] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: Haojian Zhuang , Qing Xu , linux-kernel@vger.kernel.org, Arnd Bergmann , Samuel Ortiz X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Patch fe527ea5a "mfd: max8925: Support dt for backlight" added a new function for DT probing but introduced a build warning for the case where CONFIG_OF is disabled: drivers/video/backlight/max8925_bl.c: In function 'max8925_backlight_probe': drivers/video/backlight/max8925_bl.c:177:3: warning: statement with no effect [-Wunused-value] A much nicer fix is to use the IS_ENABLED keyword to have the same effect of dropping the device tree specific function when it's not needed. Signed-off-by: Arnd Bergmann Cc: Qing Xu Cc: Haojian Zhuang Cc: Samuel Ortiz Acked-by: Haojian Zhuang --- drivers/video/backlight/max8925_bl.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/video/backlight/max8925_bl.c b/drivers/video/backlight/max8925_bl.c index 5ca11b0..9958fb1 100644 --- a/drivers/video/backlight/max8925_bl.c +++ b/drivers/video/backlight/max8925_bl.c @@ -101,14 +101,13 @@ static const struct backlight_ops max8925_backlight_ops = { .get_brightness = max8925_backlight_get_brightness, }; -#ifdef CONFIG_OF static int max8925_backlight_dt_init(struct platform_device *pdev, struct max8925_backlight_pdata *pdata) { struct device_node *nproot = pdev->dev.parent->of_node, *np; int dual_string; - if (!nproot) + if (!nproot || !IS_ENABLED(CONFIG_OF)) return -ENODEV; np = of_find_node_by_name(nproot, "backlight"); if (!np) { @@ -120,9 +119,6 @@ static int max8925_backlight_dt_init(struct platform_device *pdev, pdata->dual_string = dual_string; return 0; } -#else -#define max8925_backlight_dt_init(x, y) (-1) -#endif static int max8925_backlight_probe(struct platform_device *pdev) {