Skip to contentSkip to conversation

regulator: max20411: Fix off-by-one for n_voltages setting

PATCH In review Axel Lin 2 participants 2 messages Feb 11, 2023 – Feb 13, 2023 Voltage and current regulator framework

lore
Share & tools
lore

Axel Lin

author
#0 lore raw

PATCH 1/1 regulator: max20411: Fix off-by-one for n_voltages setting

Otherwise regulator_list_voltage returns -EINVAL for MAX20411_MAX_SEL.

---
 drivers/regulator/max20411-regulator.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/regulator/max20411-regulator.c +1 -1
index e75d16048e2f..83dacb4ff173 100644
@@ -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,
Signature · 1 line
2.34.1
maintainer
#1 lore raw
Quoted 3 lines · Axel Lin

Otherwise regulator_list_voltage returns -EINVAL for MAX20411_MAX_SEL.

Applied to

broonie/regulator.git for-next

Thanks!

[1/1] regulator: max20411: Fix off-by-one for n_voltages setting

      commit: 9d1c73191f94c79076b5f46a31b8a1e12b18bc79

All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying to this mail.

Thanks,
Mark