diff options
author | Lokesh Vutla <lokeshvutla@ti.com> | 2018-12-24 16:37:41 +0530 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2018-12-27 07:48:31 -0500 |
commit | e17e0ceb83538c015a50b965547f2f4d38f81c5d (patch) | |
tree | 15364a84e350a1a71ead52ead1b313a6dad2a3a5 /drivers/power | |
parent | ca80b561e18b69f55a632f12f0ca0ffa04456c69 (diff) | |
download | u-boot-e17e0ceb83538c015a50b965547f2f4d38f81c5d.tar.gz u-boot-e17e0ceb83538c015a50b965547f2f4d38f81c5d.tar.bz2 u-boot-e17e0ceb83538c015a50b965547f2f4d38f81c5d.zip |
power: regulator: Return success on attempt to disable an always-on regulator
commit 4f86a724e82c0 ("power: regulator: denied disable on always-on
regulator") throws an error when requested to disable an always-on
regulator. It is right that an always-on regulator should not be
attempted to be disabled. But at the same time regulator framework
should not return an error when such request is received. Instead
it should just return success without attempting to disable the
specified regulator. This is because the requesting driver will
not have the idea if the regulator is always-on or not. The
requesting driver will always try to enable/disable regulator as
per the required flow. So it is upto regulator framework to not
break such scenarios.
Fixes: 4f86a724e82c0 ("power: regulator: denied disable on always-on regulator")
Reported-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
Reviewed-by: Faiz Abbas <faiz_abbas@ti.com>
Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Diffstat (limited to 'drivers/power')
-rw-r--r-- | drivers/power/regulator/regulator-uclass.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/power/regulator/regulator-uclass.c b/drivers/power/regulator/regulator-uclass.c index 4511625ff2..39e46279d5 100644 --- a/drivers/power/regulator/regulator-uclass.c +++ b/drivers/power/regulator/regulator-uclass.c @@ -113,7 +113,7 @@ int regulator_set_enable(struct udevice *dev, bool enable) uc_pdata = dev_get_uclass_platdata(dev); if (!enable && uc_pdata->always_on) - return -EACCES; + return 0; return ops->set_enable(dev, enable); } |