* [PATCH v2] regulator: Don't error out fixed regulator in regulator_sync_voltage()
@ 2021-10-21 18:33 Dmitry Osipenko
2021-10-23 19:58 ` Mark Brown
0 siblings, 1 reply; 2+ messages in thread
From: Dmitry Osipenko @ 2021-10-21 18:33 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 regulators that are incapable to change voltage.
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>
---
Changelog:
v2: - Check regulator's voltage-change capability instead of checking
whether it's a fixed regulator.
drivers/regulator/core.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index 26bee444fc70..86aa4141efa9 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 = ®ulator->voltage[PM_SUSPEND_ON];
int ret, min_uV, max_uV;
+ if (!regulator_ops_is_valid(rdev, REGULATOR_CHANGE_VOLTAGE))
+ return 0;
+
regulator_lock(rdev);
if (!rdev->desc->ops->set_voltage &&
--
2.32.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH v2] regulator: Don't error out fixed regulator in regulator_sync_voltage()
2021-10-21 18:33 [PATCH v2] regulator: Don't error out fixed regulator in regulator_sync_voltage() Dmitry Osipenko
@ 2021-10-23 19:58 ` Mark Brown
0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2021-10-23 19:58 UTC (permalink / raw)
To: Dmitry Osipenko, Jonathan Hunter, Thierry Reding
Cc: Mark Brown, linux-tegra, linux-kernel
On Thu, 21 Oct 2021 21:33:08 +0300, Dmitry Osipenko wrote:
> Fixed regulator can't change voltage and regulator_sync_voltage()
> returns -EINVAL in this case. Make regulator_sync_voltage() to succeed
> for regulators that are incapable to change voltage.
>
> 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.
>
> [...]
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git for-next
Thanks!
[1/1] regulator: Don't error out fixed regulator in regulator_sync_voltage()
commit: 400d5a5da43c0e84e5aa75151082ea91f0fae3c9
All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying
to this mail.
Thanks,
Mark
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-10-23 19:58 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-10-21 18:33 [PATCH v2] regulator: Don't error out fixed regulator in regulator_sync_voltage() Dmitry Osipenko
2021-10-23 19:58 ` Mark Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox