diff options
author | Mark Brown <broonie@linaro.org> | 2014-02-04 12:58:17 +0000 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2014-02-04 12:58:17 +0000 |
commit | 00e674702438b8b2abc9dd6b8b49d54a3e99baa7 (patch) | |
tree | 8383b6b671a0cc2a67c7320e7126623cbcb20a21 /drivers/regulator | |
parent | 38dbfb59d1175ef458d006556061adeaa8751b72 (diff) | |
parent | 317b5684d52269b75b4ec6480f9dac056d0d4ba8 (diff) |
Merge remote-tracking branch 'regulator/fix/core' into regulator-linus
Diffstat (limited to 'drivers/regulator')
-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, if (r->dev.parent && node == r->dev.of_node) return r; + *ret = -EPROBE_DEFER; + return NULL; } else { /* * 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, struct regulator_dev *rdev; struct regulator *regulator = ERR_PTR(-EPROBE_DEFER); const char *devname = NULL; - int ret = -EPROBE_DEFER; + int ret; if (id == NULL) { pr_err("get() with no identifier\n"); @@ -1322,6 +1324,11 @@ static struct regulator *_regulator_get(struct device *dev, const char *id, if (dev) devname = dev_name(dev); + if (have_full_constraints()) + ret = -ENODEV; + else + ret = -EPROBE_DEFER; + mutex_lock(®ulator_list_mutex); rdev = regulator_dev_lookup(dev, id, &ret); |