diff options
-rw-r--r-- | drivers/regulator/core.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c index a51e1e5fdff3..73edb0ef6e17 100644 --- a/drivers/regulator/core.c +++ b/drivers/regulator/core.c | |||
@@ -1229,7 +1229,7 @@ static struct regulator *_regulator_get(struct device *dev, const char *id, | |||
1229 | struct regulator_dev *rdev; | 1229 | struct regulator_dev *rdev; |
1230 | struct regulator *regulator = ERR_PTR(-EPROBE_DEFER); | 1230 | struct regulator *regulator = ERR_PTR(-EPROBE_DEFER); |
1231 | const char *devname = NULL; | 1231 | const char *devname = NULL; |
1232 | int ret; | 1232 | int ret = 0; |
1233 | 1233 | ||
1234 | if (id == NULL) { | 1234 | if (id == NULL) { |
1235 | pr_err("get() with no identifier\n"); | 1235 | pr_err("get() with no identifier\n"); |
@@ -1245,6 +1245,15 @@ static struct regulator *_regulator_get(struct device *dev, const char *id, | |||
1245 | if (rdev) | 1245 | if (rdev) |
1246 | goto found; | 1246 | goto found; |
1247 | 1247 | ||
1248 | /* | ||
1249 | * If we have return value from dev_lookup fail, we do not expect to | ||
1250 | * succeed, so, quit with appropriate error value | ||
1251 | */ | ||
1252 | if (ret) { | ||
1253 | regulator = ERR_PTR(ret); | ||
1254 | goto out; | ||
1255 | } | ||
1256 | |||
1248 | if (board_wants_dummy_regulator) { | 1257 | if (board_wants_dummy_regulator) { |
1249 | rdev = dummy_regulator_rdev; | 1258 | rdev = dummy_regulator_rdev; |
1250 | goto found; | 1259 | goto found; |