Skip to content
This repository was archived by the owner on Nov 8, 2023. It is now read-only.

Commit 9d1c731

Browse files
AxelLinbroonie
authored andcommitted
regulator: max20411: Fix off-by-one for n_voltages setting
Otherwise regulator_list_voltage returns -EINVAL for MAX20411_MAX_SEL. Signed-off-by: Axel Lin <axel.lin@ingics.com> Link: https://lore.kernel.org/r/20230211150019.1545542-1-axel.lin@ingics.com Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 6caacd8 commit 9d1c731

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/regulator/max20411-regulator.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ static const struct regulator_desc max20411_desc = {
8585
.min_uV = MAX20411_BASE_UV,
8686
.uV_step = MAX20411_UV_STEP,
8787
.linear_min_sel = MAX20411_MIN_SEL,
88-
.n_voltages = MAX20411_MAX_SEL,
88+
.n_voltages = MAX20411_MAX_SEL + 1,
8989

9090
.vsel_reg = MAX20411_VID_OFFSET,
9191
.vsel_mask = MAX20411_VID_MASK,

0 commit comments

Comments
 (0)