All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] regulator: Allow autosetting fixed regulators
@ 2019-05-31  7:27 Sven Schwermer
  2019-05-31  7:49 ` Peng Fan
  2019-05-31  9:34 ` Peng Fan
  0 siblings, 2 replies; 11+ messages in thread
From: Sven Schwermer @ 2019-05-31  7:27 UTC (permalink / raw)
  To: u-boot

Fixed regulators don't have a set_value method. Therefore,
regulator_set_value will return -ENOSYS when called from
regulator_autoset.

Accepting this return value allows autosetting fixed regulators.

Signed-off-by: Sven Schwermer <sven@svenschwermer.de>
Cc: Jaehoon Chung <jh80.chung@samsung.com>
Cc: Peng Fan <peng.fan@nxp.com>
---
 drivers/power/regulator/regulator-uclass.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/power/regulator/regulator-uclass.c b/drivers/power/regulator/regulator-uclass.c
index 9118b8eb39..0b99c262ac 100644
--- a/drivers/power/regulator/regulator-uclass.c
+++ b/drivers/power/regulator/regulator-uclass.c
@@ -243,7 +243,7 @@ int regulator_autoset(struct udevice *dev)
 	if (!ret && (uc_pdata->flags & REGULATOR_FLAG_AUTOSET_UA))
 		ret = regulator_set_current(dev, uc_pdata->min_uA);
 
-	if (!ret)
+	if (!ret || ret == -ENOSYS)
 		ret = regulator_set_enable(dev, true);
 
 	return ret;
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2019-07-14 13:08 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-31  7:27 [U-Boot] [PATCH] regulator: Allow autosetting fixed regulators Sven Schwermer
2019-05-31  7:49 ` Peng Fan
2019-05-31  8:17   ` Sven Schwermer
2019-05-31  8:23     ` Peng Fan
2019-05-31  8:29       ` Sven Schwermer
2019-05-31  9:34 ` Peng Fan
2019-05-31 10:44   ` Sven Schwermer
2019-06-04  2:34     ` Peng Fan
2019-06-12  6:32       ` [U-Boot] [PATCH v2] " Sven Schwermer
2019-06-22 19:10         ` Simon Glass
2019-07-14 13:08         ` Tom Rini

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.