lkml.org 
[lkml]   [2013]   [May]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v2 1/3] imx-drm: imx-tve: Check the return value of 'regulator_enable()'
Date
Since commit c8801a8 (regulator: core: Mark all get and enable calls as 
__must_check) we need to check the value returned by 'regulator_enable()'.

Do this check to get rid of the following build warning:

drivers/staging/imx-drm/imx-tve.c: In function 'imx_tve_probe':
drivers/staging/imx-drm/imx-tve.c:671:19: warning: ignoring return value of 'regulator_enable', declared with attribute warn_unused_result [-Wunused-result]

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Acked-by: Shawn Guo <shawn.guo@linaro.org>
Acked-by: Sascha Hauer <s.hauer@pengutronix.de>
---
Changes since v1:
- Use 'build warning' instead of 'build error' in commit log
- Also mention the commit that requires the checking
- Added Ack's

drivers/staging/imx-drm/imx-tve.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/imx-drm/imx-tve.c b/drivers/staging/imx-drm/imx-tve.c
index a6efa8f6..ce65ad3 100644
--- a/drivers/staging/imx-drm/imx-tve.c
+++ b/drivers/staging/imx-drm/imx-tve.c
@@ -668,7 +668,9 @@ static int imx_tve_probe(struct platform_device *pdev)
tve->dac_reg = devm_regulator_get(&pdev->dev, "dac");
if (!IS_ERR(tve->dac_reg)) {
regulator_set_voltage(tve->dac_reg, 2750000, 2750000);
- regulator_enable(tve->dac_reg);
+ ret = regulator_enable(tve->dac_reg);
+ if (ret)
+ return ret;
}

tve->clk = devm_clk_get(&pdev->dev, "tve");
--
1.8.1.2



\
 
 \ /
  Last update: 2013-05-21 17:01    [W:0.018 / U:0.360 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site