mirror of
https://github.com/edk2-porting/linux-next.git
synced 2024-12-23 12:43:55 +08:00
regulator: core: return err value for regulator_get if there is no DT binding
commit 6d191a5fc7
(regulator: core: Don't defer probe if there's no DT binding for a supply)
Attempted to differentiate between regulator_get() with an actual
DT binding for the supply and when there is none to avoid unnecessary
deferal.
However, ret value supplied by regulator_dev_lookup() is being
ignored by regulator_get(). So, exit with the appropriate return value.
Signed-off-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
This commit is contained in:
parent
0f7b87f0ac
commit
1e4b545cdd
@ -1229,7 +1229,7 @@ static struct regulator *_regulator_get(struct device *dev, const char *id,
|
|||||||
struct regulator_dev *rdev;
|
struct regulator_dev *rdev;
|
||||||
struct regulator *regulator = ERR_PTR(-EPROBE_DEFER);
|
struct regulator *regulator = ERR_PTR(-EPROBE_DEFER);
|
||||||
const char *devname = NULL;
|
const char *devname = NULL;
|
||||||
int ret;
|
int ret = 0;
|
||||||
|
|
||||||
if (id == NULL) {
|
if (id == NULL) {
|
||||||
pr_err("get() with no identifier\n");
|
pr_err("get() with no identifier\n");
|
||||||
@ -1245,6 +1245,15 @@ static struct regulator *_regulator_get(struct device *dev, const char *id,
|
|||||||
if (rdev)
|
if (rdev)
|
||||||
goto found;
|
goto found;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* If we have return value from dev_lookup fail, we do not expect to
|
||||||
|
* succeed, so, quit with appropriate error value
|
||||||
|
*/
|
||||||
|
if (ret) {
|
||||||
|
regulator = ERR_PTR(ret);
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
|
||||||
if (board_wants_dummy_regulator) {
|
if (board_wants_dummy_regulator) {
|
||||||
rdev = dummy_regulator_rdev;
|
rdev = dummy_regulator_rdev;
|
||||||
goto found;
|
goto found;
|
||||||
|
Loading…
Reference in New Issue
Block a user