Skip to content

Commit 400d5a5

Browse files
digetxbroonie
authored andcommitted
regulator: Don't error out fixed regulator in regulator_sync_voltage()
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]>
1 parent 3253e24 commit 400d5a5

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

drivers/regulator/core.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4249,6 +4249,9 @@ int regulator_sync_voltage(struct regulator *regulator)
42494249
struct regulator_voltage *voltage = &regulator->voltage[PM_SUSPEND_ON];
42504250
int ret, min_uV, max_uV;
42514251

4252+
if (!regulator_ops_is_valid(rdev, REGULATOR_CHANGE_VOLTAGE))
4253+
return 0;
4254+
42524255
regulator_lock(rdev);
42534256

42544257
if (!rdev->desc->ops->set_voltage &&

0 commit comments

Comments
 (0)