]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
cmd: led: fix help text for blink subcommand
authorQuentin Schulz <quentin.schulz@cherry.de>
Wed, 12 Nov 2025 17:48:06 +0000 (18:48 +0100)
committerTom Rini <trini@konsulko.com>
Wed, 3 Dec 2025 17:03:45 +0000 (11:03 -0600)
The blink subcommand actually requires an additional parameter
(blink-freq) but not the others.

In order to simplify the help text, split the blink subcommand help text
from the off|on|toggle subcommands.

Then, fix the help text so that it is clear that the frequency is
required.

While at it, specify the duty cycle.

Fixes: ffe2052d6e8a ("dm: led: Add a new 'led' command")
Signed-off-by: Quentin Schulz <quentin.schulz@cherry.de>
cmd/led.c

index 91fb856ee5989c43e6dfb866168b0487ebc3b919..296c07b3b38ba20f8f900106cc14a66da1ea8a61 100644 (file)
--- a/cmd/led.c
+++ b/cmd/led.c
@@ -118,16 +118,13 @@ int do_led(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
        return 0;
 }
 
-#if defined(CONFIG_LED_BLINK) || defined(CONFIG_LED_SW_BLINK)
-#define BLINK "|blink [blink-freq in ms]"
-#else
-#define BLINK ""
-#endif
-
 U_BOOT_CMD(
        led, 4, 1, do_led,
        "manage LEDs",
-       "<led_label> on|off|toggle" BLINK "\tChange LED state\n"
+       "<led_label> on|off|toggle\tChange LED state\n"
+#if defined(CONFIG_LED_BLINK) || defined(CONFIG_LED_SW_BLINK)
+       "led <led_label> blink <blink-freq in ms>\tBlink LED (duty cycle 50%)\n"
+#endif
        "led <led_label>\tGet LED state\n"
        "led list\t\tshow a list of LEDs"
 );