]> Git Repo - linux.git/commitdiff
regulator: Don't error out fixed regulator in regulator_sync_voltage()
authorDmitry Osipenko <[email protected]>
Thu, 21 Oct 2021 18:33:08 +0000 (21:33 +0300)
committerMark Brown <[email protected]>
Sat, 23 Oct 2021 13:21:11 +0000 (14:21 +0100)
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 <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
drivers/regulator/core.c

index 21a2b28ab0caeb29e2d2660bdf2927faced230c5..f6ca2098cc01de5d8b5512216d533a7cd54d43c4 100644 (file)
@@ -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 (!regulator_ops_is_valid(rdev, REGULATOR_CHANGE_VOLTAGE))
+               return 0;
+
        regulator_lock(rdev);
 
        if (!rdev->desc->ops->set_voltage &&
This page took 0.063396 seconds and 4 git commands to generate.