regulator: core: allow enabling without enable op
PATCH 1/1 regulator: core: allow enabling without enable op
Commit 14c32a3ce6676265d7a27ea64a4d406e6dbad111 replaced direct uses of ops->enable by calls to _regulator_do_enable. This prevents a fixed regulators without a GPIO from being probed, since the former code checked the existence of ops->enable and continued if it did not exist, while _regulator_do_enable return -EINVAL in that case.
This patch fixes this by allowing _regulator_do_enable to go through without error if ops->enable is not defined, similarly to what _regulator_do_disable already does.
--- drivers/regulator/core.c | 2 -- 1 file changed, 2 deletions(-)
drivers/regulator/core.c +0 -2
@@ -1763,8 +1763,6 @@ static int _regulator_do_enable(struct regulator_dev *rdev) ret = rdev->desc->ops->enable (rdev);if (ret <0 )return ret; - }else { -return -EINVAL ; }/* Allow the regulator to ramp; it would be useful to extend
Signature · 1 line
1.9.0
Quoted 11 lines · Alexandre Courbot
Commit
14c32a3ce6676265d7a27ea64a4d406e6dbad111replaced direct uses ofops->enableby calls to_regulator_do_enable. This prevents a fixed regulators without a GPIO from being probed, since the former code checked the existence ofops->enableand continued if it did not exist, while_regulator_do_enablereturn-EINVALin that case.This patch fixes this by allowing
_regulator_do_enableto go through without error ifops->enableis not defined, similarly to what_regulator_do_disablealready does.Signed-off-by Alexandre Courbot <[email protected]>
This patch fixes the fixed regulator registration failure on Exynos5420 board.
Signature · 2 lines
With warm regards, Sachin