Skip to content

Commit d371a0f

Browse files
mjchen0carlescufi
authored andcommitted
drivers: regulator: shell: fix strcmp usage bug in cmd_adset
Bug in "enable/disable" argument parsing would cause the oppostive of the requested setting to get passed to active discharge API invocation. Signed-off-by: Mike J. Chen <[email protected]>
1 parent 7374678 commit d371a0f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/regulator/regulator_shell.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -398,9 +398,9 @@ static int cmd_adset(const struct shell *sh, size_t argc, char **argv)
398398
return -ENODEV;
399399
}
400400

401-
if (strcmp(argv[2], "enable")) {
401+
if (strcmp(argv[2], "enable") == 0) {
402402
ad = true;
403-
} else if (strcmp(argv[2], "disable")) {
403+
} else if (strcmp(argv[2], "disable") == 0) {
404404
ad = false;
405405
} else {
406406
shell_error(sh, "Invalid parameter");

0 commit comments

Comments
 (0)