mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: linux-arm-kernel@lists.infradead.org
Cc: linux-kernel@vger.kernel.org, Arnd Bergmann <arnd@arndb.de>,
	Qing Xu <qingx@marvell.com>,
	Haojian Zhuang <haojian.zhuang@gmail.com>,
	Samuel Ortiz <sameo@linux.intel.com>
Subject: [PATCH 4/9] mfd: max8925: fix trivial build warning for non-dt
Date: Thu, 14 Feb 2013 23:26:53 +0100	[thread overview]
Message-ID: <1360880818-4071454-5-git-send-email-arnd@arndb.de> (raw)
In-Reply-To: <1360880818-4071454-1-git-send-email-arnd@arndb.de>

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 <arnd@arndb.de>
Cc: Qing Xu <qingx@marvell.com>
Cc: Haojian Zhuang <haojian.zhuang@gmail.com>
Cc: Samuel Ortiz <sameo@linux.intel.com>
---
 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)
 {
-- 
1.8.1.2


  parent reply	other threads:[~2013-02-14 22:27 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-14 22:26 [PATCH 0/9] linux-next ARM defconfig fixes Arnd Bergmann
2013-02-14 22:26 ` [PATCH 1/9] ARM: sa1100/assabet: include platform_device.h directly Arnd Bergmann
2013-02-14 22:26 ` [PATCH 2/9] fb/exynos: include platform_device.h Arnd Bergmann
2013-02-14 22:26 ` [PATCH 3/9] clk: sunxi: remove stale Makefile entry Arnd Bergmann
2013-02-15  4:54   ` Mike Turquette
2013-02-15 12:08     ` Arnd Bergmann
2013-02-14 22:26 ` Arnd Bergmann [this message]
2013-02-15  1:25   ` [PATCH 4/9] mfd: max8925: fix trivial build warning for non-dt Haojian Zhuang
2013-02-15  3:32   ` Qing Xu
2013-03-11 16:31   ` Arnd Bergmann
2013-02-14 22:26 ` [PATCH 5/9] ARM: shmobile: mark mackerel sh_mmcif_device __maybe_unused Arnd Bergmann
2013-02-14 23:24   ` Simon Horman
2013-02-15 12:55     ` Arnd Bergmann
2013-02-15 13:15       ` Simon Horman
2013-02-14 22:26 ` [PATCH 6/9] drm/pci: move drm_pcie_get_speed_cap_mask inside #ifdef CONFIG_PCI Arnd Bergmann
2013-02-14 22:41   ` Fabio Estevam
2013-02-14 22:52     ` Arnd Bergmann
2013-02-14 22:26 ` [PATCH 7/9] ARM defconfigs: add missing inclusions of linux/platform_device.h Arnd Bergmann
2013-02-14 23:05   ` Greg Kroah-Hartman
2013-02-15 14:16     ` fb: mmp: include linux/platform_device.h Arnd Bergmann
2013-02-17 15:45       ` Haojian Zhuang
2013-02-14 22:26 ` [PATCH 8/9] [media] s5p-fimc: fix s5pv210 build Arnd Bergmann
2013-02-14 22:26 ` [PATCH 9/9] thermal: rcar: remove __devinitconst Arnd Bergmann
2013-02-19 15:48   ` Zhang Rui

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1360880818-4071454-5-git-send-email-arnd@arndb.de \
    --to=arnd@arndb.de \
    --cc=haojian.zhuang@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=qingx@marvell.com \
    --cc=sameo@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®