public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1] regulator: Don't error out fixed regulator in regulator_sync_voltage()
@ 2021-10-21 11:07 Dmitry Osipenko
  2021-10-21 13:12 ` Mark Brown
  0 siblings, 1 reply; 5+ messages in thread
From: Dmitry Osipenko @ 2021-10-21 11:07 UTC (permalink / raw)
  To: Thierry Reding, Jonathan Hunter, Mark Brown; +Cc: linux-kernel, linux-tegra

Fixed regulator can't change voltage and regulator_sync_voltage() returns
-EINVAL in this case. Make regulator_sync_voltage() to succeed for a fixed
regulator.

On NVIDIA Tegra power management driver needs to sync voltage and we have
one device (Trimslice) that uses fixed regulator which is getting synced.
The syncing error isn't treated as fatal, but produces a noisy error
message. This patch silences that error.

Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
---
 drivers/regulator/core.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index 26bee444fc70..e1324edb3f8d 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -4249,6 +4249,9 @@ int regulator_sync_voltage(struct regulator *regulator)
 	struct regulator_voltage *voltage = &regulator->voltage[PM_SUSPEND_ON];
 	int ret, min_uV, max_uV;
 
+	if (rdev->desc->fixed_uV && rdev->desc->n_voltages == 1)
+		return 0;
+
 	regulator_lock(rdev);
 
 	if (!rdev->desc->ops->set_voltage &&
-- 
2.32.0


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

end of thread, other threads:[~2021-10-21 14:33 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-10-21 11:07 [PATCH v1] regulator: Don't error out fixed regulator in regulator_sync_voltage() Dmitry Osipenko
2021-10-21 13:12 ` Mark Brown
2021-10-21 13:46   ` Dmitry Osipenko
2021-10-21 13:55     ` Dmitry Osipenko
2021-10-21 14:33       ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox