Skip to contentSkip to conversation

regulator: core: Fix return code for invalid parameters

PATCH New Mark Brown 1 participant 1 message Sep 20, 2013 Voltage and current regulator framework

lore
Share & tools
lore

Mark Brown

author maintainer
#0 lore raw

PATCH 1/1 regulator: core: Fix return code for invalid parameters

From: Mark Brown <[email protected]>

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

---
 drivers/regulator/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/regulator/core.c +1 -1
index 353779b..dfdec27 100644
@@ -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)
Signature · 1 line
1.8.4.rc3