mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] regulator: core: Fix return code for invalid parameters
@ 2013-09-20 11:33 Mark Brown
  0 siblings, 0 replies; only message in thread
From: Mark Brown @ 2013-09-20 11:33 UTC (permalink / raw)
  To: Liam Girdwood; +Cc: linux-kernel, Mark Brown

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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2013-09-20 11:34 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-09-20 11:33 [PATCH] regulator: core: Fix return code for invalid parameters Mark Brown

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®