From 043c998f95036e7fc796b240ab5ba49a8de36df3 Mon Sep 17 00:00:00 2001 From: Mark Brown Date: Fri, 20 Sep 2013 12:32:18 +0100 Subject: [PATCH] regulator: core: Fix return code for invalid parameters We should be returning an error, a repeated call will never succeed. Signed-off-by: Mark Brown --- 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 66ae12d12c10..ad154247bb90 100644 --- a/drivers/regulator/core.c +++ b/drivers/regulator/core.c @@ -1288,7 +1288,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) -- 2.11.0