summaryrefslogtreecommitdiff
path: root/cmd/led.c
diff options
context:
space:
mode:
authorHeiko Schocher <hs@denx.de>2019-05-27 08:14:16 +0200
committerTom Rini <trini@konsulko.com>2019-06-05 12:14:02 -0400
commitea41b15617fa6869a6bb628dad8f972db4d77139 (patch)
tree2414554a9caff9998089915eefc4c4e9fce044f3 /cmd/led.c
parentc5646270d1783982fc76eff831e5f3e63cb626cd (diff)
cmd/led: check subcommand "list" instead "l"
current implementation for checking if "led list" command is called checks only if "l" is passed to the led command. This prevents switching leds with name which starts also with a "l". So check for passing "list". While at it, also fix a typo in led command usage. Signed-off-by: Heiko Schocher <hs@denx.de>
Diffstat (limited to 'cmd/led.c')
-rw-r--r--cmd/led.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/cmd/led.c b/cmd/led.c
index fc07ca95a3..403abbc6bc 100644
--- a/cmd/led.c
+++ b/cmd/led.c
@@ -85,7 +85,7 @@ int do_led(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
if (argc < 2)
return CMD_RET_USAGE;
led_label = argv[1];
- if (*led_label == 'l')
+ if (strncmp(led_label, "list", 4) == 0)
return list_leds();
cmd = argc > 2 ? get_led_cmd(argv[2]) : LEDST_COUNT;
@@ -137,6 +137,6 @@ U_BOOT_CMD(
led, 4, 1, do_led,
"manage LEDs",
"<led_label> on|off|toggle" BLINK "\tChange LED state\n"
- "led [<led_label>\tGet LED state\n"
+ "led [<led_label>]\tGet LED state\n"
"led list\t\tshow a list of LEDs"
);