diff options
author | Axel Lin <axel.lin@ingics.com> | 2023-02-11 23:00:19 +0800 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2023-02-13 12:45:00 +0000 |
commit | 9d1c73191f94c79076b5f46a31b8a1e12b18bc79 (patch) | |
tree | 7292b5fd74d075fa6d4fd68d995983d567139c08 /drivers/regulator | |
parent | 6caacd82f09c183a91951776cd8d326e46ef84b4 (diff) |
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>
Diffstat (limited to 'drivers/regulator')
-rw-r--r-- | drivers/regulator/max20411-regulator.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/regulator/max20411-regulator.c b/drivers/regulator/max20411-regulator.c index e75d16048e2f..83dacb4ff173 100644 --- a/drivers/regulator/max20411-regulator.c +++ b/drivers/regulator/max20411-regulator.c @@ -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, |