[PATCH 2/2] regulator: pwm-regulator: Revert "Add validity checks in continuous .get_voltage"
From: Mike Looijmans
Date: Fri Nov 06 2026 - 08:01:25 EST
This reverts commit c92688cac239 ("regulator: pwm-regulator: Add validity
checks in continuous .get_voltage").
The core, and in particular the machine_constraints_voltage() method,
expects the regulator to report what the current setting is, even if that
is outside the allowed range. The core will then bring the voltage into
that range. It cannot do that if the regulator refuses to return its
setting, and causes probe() to fail for a pwm-regulator when it has
restrictions to the PWM range with messages like:
dsp7-pwm: failed to get the current voltage: -ENOTRECOVERABLE
pwm-regulator dsp7-supply-pwm: error -ENOTRECOVERABLE: Failed to register
regulator pwm-regulator
pwm-regulator dsp7-supply-pwm: probe with driver pwm-regulator failed
with error -131
Besides that, regulator_get_voltage() is not supposed to return any
state information, as is mentioned in the API documentation.
Signed-off-by: Mike Looijmans <mike.looijmans@xxxxxxxx>
---
drivers/regulator/pwm-regulator.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/drivers/regulator/pwm-regulator.c b/drivers/regulator/pwm-regulator.c
index f50530c77d92f..00fcf9a172b47 100644
--- a/drivers/regulator/pwm-regulator.c
+++ b/drivers/regulator/pwm-regulator.c
@@ -158,9 +158,6 @@ static int pwm_regulator_get_voltage(struct regulator_dev *rdev)
pwm_get_state(drvdata->pwm, &pstate);
voltage = pwm_get_relative_duty_cycle(&pstate, duty_unit);
- if (voltage < min(max_uV_duty, min_uV_duty) ||
- voltage > max(max_uV_duty, min_uV_duty))
- return -ENOTRECOVERABLE;
/*
* The dutycycle for min_uV might be greater than the one for max_uV.
---
base-commit: f66469d9905b39d2c260a15d7d6db450f4db67c1
branch: linux-master-pwm-regulator
--
2.43.0
Met vriendelijke groet / kind regards,
Mike Looijmans
System Expert
TOPIC Embedded Products B.V.
Materiaalweg 4, 5681 RJ Best
The Netherlands
T: +31 (0) 499 33 69 69
E: mike.looijmans@xxxxxxxx
W: www.topic.nl
Please consider the environment before printing this e-mail