]> git.baikalelectronics.ru Git - uboot.git/commit
power: regulator: fix autoset error handling
authorJohn Keeping <john@metanate.com>
Thu, 8 Sep 2022 11:38:35 +0000 (12:38 +0100)
committerJaehoon Chung <jh80.chung@samsung.com>
Wed, 26 Oct 2022 02:47:12 +0000 (11:47 +0900)
commit5c9bff8f5824770e8303e4ff5ee66b13d3f062b2
tree66c5a8911e07e89911351693f6694c7101bccfdd
parent7bb4aecfea1061eed1492d4d7c6b3c2274cec1f8
power: regulator: fix autoset error handling

If a regulator does not support .set_suspend_enable or
.set_suspend_value then ret is set to ENOSYS early in the function.

The most serious impact of this is that when no automatic setting of
voltage is needed then the final regulator_set_enable() is skipped
because ret has not been cleared.

It seems that the error handling for regulator_set_suspend_value() is
also wrong as if this succeeds then the normal boot-on checks are still
required, and again ENOSYS needs special treatment here.

Fixes: b8931caa4b ("dm: regulator: support regulator more state")
Signed-off-by: John Keeping <john@metanate.com>
drivers/power/regulator/regulator-uclass.c