diff options
-rw-r--r-- | drivers/regulator/core.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c index b38a6b669e8c..16a309e5c024 100644 --- a/drivers/regulator/core.c +++ b/drivers/regulator/core.c | |||
@@ -1272,6 +1272,8 @@ static struct regulator_dev *regulator_dev_lookup(struct device *dev, | |||
1272 | if (r->dev.parent && | 1272 | if (r->dev.parent && |
1273 | node == r->dev.of_node) | 1273 | node == r->dev.of_node) |
1274 | return r; | 1274 | return r; |
1275 | *ret = -EPROBE_DEFER; | ||
1276 | return NULL; | ||
1275 | } else { | 1277 | } else { |
1276 | /* | 1278 | /* |
1277 | * If we couldn't even get the node then it's | 1279 | * If we couldn't even get the node then it's |
@@ -1312,7 +1314,7 @@ static struct regulator *_regulator_get(struct device *dev, const char *id, | |||
1312 | struct regulator_dev *rdev; | 1314 | struct regulator_dev *rdev; |
1313 | struct regulator *regulator = ERR_PTR(-EPROBE_DEFER); | 1315 | struct regulator *regulator = ERR_PTR(-EPROBE_DEFER); |
1314 | const char *devname = NULL; | 1316 | const char *devname = NULL; |
1315 | int ret = -EPROBE_DEFER; | 1317 | int ret; |
1316 | 1318 | ||
1317 | if (id == NULL) { | 1319 | if (id == NULL) { |
1318 | pr_err("get() with no identifier\n"); | 1320 | pr_err("get() with no identifier\n"); |
@@ -1322,6 +1324,11 @@ static struct regulator *_regulator_get(struct device *dev, const char *id, | |||
1322 | if (dev) | 1324 | if (dev) |
1323 | devname = dev_name(dev); | 1325 | devname = dev_name(dev); |
1324 | 1326 | ||
1327 | if (have_full_constraints()) | ||
1328 | ret = -ENODEV; | ||
1329 | else | ||
1330 | ret = -EPROBE_DEFER; | ||
1331 | |||
1325 | mutex_lock(®ulator_list_mutex); | 1332 | mutex_lock(®ulator_list_mutex); |
1326 | 1333 | ||
1327 | rdev = regulator_dev_lookup(dev, id, &ret); | 1334 | rdev = regulator_dev_lookup(dev, id, &ret); |