All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sven Schwermer <sven@svenschwermer.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] regulator: Allow autosetting fixed regulators
Date: Fri, 31 May 2019 09:27:29 +0200	[thread overview]
Message-ID: <20190531072729.16487-1-sven@svenschwermer.de> (raw)

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

             reply	other threads:[~2019-05-31  7:27 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-31  7:27 Sven Schwermer [this message]
2019-05-31  7:49 ` [U-Boot] [PATCH] regulator: Allow autosetting fixed regulators 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190531072729.16487-1-sven@svenschwermer.de \
    --to=sven@svenschwermer.de \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.