From ea7293e4643a2e80d3b7eb58d4e719102dafc57e Mon Sep 17 00:00:00 2001 From: Gerard Marull-Paretas Date: Tue, 27 Dec 2022 16:39:56 +0100 Subject: [PATCH] drivers: regulator: shell: fix printing of first voltage The first supported voltages was not printed. Signed-off-by: Gerard Marull-Paretas --- drivers/regulator/regulator_shell.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/regulator/regulator_shell.c b/drivers/regulator/regulator_shell.c index 26b85365bde..2f17a712521 100644 --- a/drivers/regulator/regulator_shell.c +++ b/drivers/regulator/regulator_shell.c @@ -146,7 +146,7 @@ static int cmd_vlist(const struct shell *sh, size_t argc, char **argv) (void)regulator_list_voltage(dev, i, &volt_uv); /* do not print repeated voltages */ - if ((i > 0U) && (last_volt_uv != volt_uv)) { + if ((i == 0U) || (last_volt_uv != volt_uv)) { microtoshell(sh, 'V', volt_uv); }