lkml.org 
[lkml]   [2013]   [Sep]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Date
Subject[PATCH] regulator: core: Fix return code for invalid parameters
From: Mark Brown <broonie@linaro.org>

We should be returning an error, a repeated call will never succeed.

Signed-off-by: Mark Brown <broonie@linaro.org>
---
drivers/regulator/core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index 353779b..dfdec27 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -1235,7 +1235,7 @@ static struct regulator *_regulator_get(struct device *dev, const char *id,

if (id == NULL) {
pr_err("get() with no identifier\n");
- return regulator;
+ return ERR_PTR(-EINVAL);
}

if (dev)
--
1.8.4.rc3


\
 
 \ /
  Last update: 2013-09-20 13:41    [W:0.072 / U:0.532 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site