Skip to content

Commit

Permalink
regulator: max20411: Fix off-by-one for n_voltages setting
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Axel Lin authored and Mark Brown committed Feb 13, 2023
1 parent 6caacd8 commit 9d1c731
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/regulator/max20411-regulator.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ static const struct regulator_desc max20411_desc = {
.min_uV = MAX20411_BASE_UV,
.uV_step = MAX20411_UV_STEP,
.linear_min_sel = MAX20411_MIN_SEL,
.n_voltages = MAX20411_MAX_SEL,
.n_voltages = MAX20411_MAX_SEL + 1,

.vsel_reg = MAX20411_VID_OFFSET,
.vsel_mask = MAX20411_VID_MASK,
Expand Down

0 comments on commit 9d1c731

Please sign in to comment.