Skip to content

Commit ec1abfc

Browse files
committed
Merge tag 'regulator-fix-v6.17-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator
Pull regulator fix from Mark Brown: "One simple fix for the pm8008 driver for poor error handling, switching to use a helper which does the right thing in the affected case" * tag 'regulator-fix-v6.17-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator: regulator: pm8008: fix probe failure due to negative voltage selector
2 parents 2bd3731 + ef3e9c9 commit ec1abfc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/regulator/qcom-pm8008-regulator.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ static int pm8008_regulator_get_voltage_sel(struct regulator_dev *rdev)
9696

9797
uV = le16_to_cpu(val) * 1000;
9898

99-
return (uV - preg->desc.min_uV) / preg->desc.uV_step;
99+
return regulator_map_voltage_linear_range(rdev, uV, INT_MAX);
100100
}
101101

102102
static const struct regulator_ops pm8008_regulator_ops = {

0 commit comments

Comments
 (0)