diff options
Diffstat (limited to 'drivers/regulator/core.c')
-rw-r--r-- | drivers/regulator/core.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c index b38a6b669e8c..d1ac4caaf1b0 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); |
@@ -1352,7 +1359,7 @@ static struct regulator *_regulator_get(struct device *dev, const char *id, | |||
1352 | goto found; | 1359 | goto found; |
1353 | /* Don't log an error when called from regulator_get_optional() */ | 1360 | /* Don't log an error when called from regulator_get_optional() */ |
1354 | } else if (!have_full_constraints() || exclusive) { | 1361 | } else if (!have_full_constraints() || exclusive) { |
1355 | dev_err(dev, "dummy supplies not allowed\n"); | 1362 | dev_warn(dev, "dummy supplies not allowed\n"); |
1356 | } | 1363 | } |
1357 | 1364 | ||
1358 | mutex_unlock(®ulator_list_mutex); | 1365 | mutex_unlock(®ulator_list_mutex); |