]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
led: remove support for red LED in legacy API
authorQuentin Schulz <quentin.schulz@cherry.de>
Wed, 19 Nov 2025 17:01:15 +0000 (18:01 +0100)
committerTom Rini <trini@konsulko.com>
Fri, 5 Dec 2025 19:38:09 +0000 (13:38 -0600)
To the exception of red_led_on in the arm-specific assembly code, all
code interacting with the red status LED was guarded by the
CONFIG_LED_STATUS_RED symbol, which is enabled in none of the upstream
defconfigs.

Since the last board which overrode the weak red_led_on function got
migrated to the new LED mechanism, there's also no user of the
arm-specific assembly code anymore, therefore it can be removed along
the other unreachable code sections.

Signed-off-by: Quentin Schulz <quentin.schulz@cherry.de>
Reviewed-by: Heiko Schocher <hs@nabladev.com>
arch/arm/lib/crt0.S
cmd/legacy_led.c
common/board_f.c
doc/api/led.rst
drivers/led/Kconfig
drivers/misc/gpio_led.c
include/status_led.h

index 9acaf2cddefe0ba2281c80eb41d9442f034f9989..d10c129705d0eb77bb0e2855b4984e685673985d 100644 (file)
@@ -183,9 +183,6 @@ here:
        movne   r9, r0
 # endif
 
-#if ! defined(CONFIG_XPL_BUILD)
-       bl red_led_on
-#endif
        /* call board_init_r(gd_t *id, ulong dest_addr) */
        mov     r0, r9                  /* gd_t */
        ldr     r1, [r9, #GD_RELOCADDR] /* dest_addr */
index 2c6d606f48b097e1749403a52cc2d6097e5c7033..4e0d09522addf1bac5fdf071a6cfbc9b0d416d80 100644 (file)
@@ -44,9 +44,6 @@ static const led_tbl_t led_commands[] = {
 #ifdef CONFIG_LED_STATUS5
        { "5", CONFIG_LED_STATUS_BIT5, NULL, NULL, NULL },
 #endif
-#endif
-#ifdef CONFIG_LED_STATUS_RED
-       { "red", CONFIG_LED_STATUS_RED, red_led_off, red_led_on, NULL },
 #endif
        { NULL, 0, NULL, NULL, NULL }
 };
@@ -158,9 +155,6 @@ U_BOOT_CMD(
 #ifdef CONFIG_LED_STATUS5
        "5|"
 #endif
-#endif
-#ifdef CONFIG_LED_STATUS_RED
-       "red|"
 #endif
        "all] [on|off|toggle|blink] [blink-freq in ms]",
        "[led_name] [on|off|toggle|blink] sets or clears led(s)"
index 74571cb6d91d3d488ba05991954ece61e421b8ed..df2b0dc899bf28e05e4594c9f9e95eebd1559157 100644 (file)
 
 DECLARE_GLOBAL_DATA_PTR;
 
-/*
- * TODO(sjg@chromium.org): IMO this code should be
- * refactored to a single function, something like:
- *
- * void led_set_state(enum led_colour_t colour, int on);
- */
-/************************************************************************
- * Coloured LED functionality
- ************************************************************************
- * May be supplied by boards if desired
- */
-__weak void red_led_on(void) {}
-__weak void red_led_off(void) {}
-
 /*
  * Why is gd allocated a register? Prior to reloc it might be better to
  * just pass it around to each function in this file?
index 6889f4878515789a18103098dff0d87deadbbb1c..9ae3f5fe252db28403e1e853c0722afad56e2788 100644 (file)
@@ -57,9 +57,6 @@ Some other LED macros
 CONFIG_STATUS_LED_BOOT is the LED to light when the board is booting.
 This must be a valid LED number (0-5).
 
-CONFIG_STATUS_LED_RED is the red LED. It is used to signal errors. This must be
-a valid LED number (0-5).
-
 General LED functions
 ~~~~~~~~~~~~~~~~~~~~~
 The following functions should be defined:
@@ -71,19 +68,6 @@ __led_set is called to change the state of the LED.
 
 __led_toggle is called to toggle the current state of the LED.
 
-Colour LED
-----------
-
-Colour LED's are at present only used by ARM.
-
-The functions names explain their purpose.
-
-- red_LED_on
-- red_LED_off
-
-These are weakly defined in arch/arm/lib/board.c to noops. Where applicable, define
-these functions in the board specific source.
-
 TBD : Describe older board dependent macros similar to what is done for
 
 TBD : Describe general support via asm/status_led.h
index 6b043f9a522340459c00f4e70876a540d0ddaa5e..cc715ceb286db1567a3d212bff73e4e71691b678 100644 (file)
@@ -400,20 +400,6 @@ config LED_STATUS_BOOT
 
 endif # LED_STATUS_BOOT_ENABLE
 
-config LED_STATUS_RED_ENABLE
-       bool "Enable red LED"
-       help
-         Enable red status LED.
-
-if LED_STATUS_RED_ENABLE
-
-config LED_STATUS_RED
-       int "Red LED identification"
-       help
-         Valid enabled LED device number.
-
-endif # LED_STATUS_RED_ENABLE
-
 config LED_STATUS_CMD
        bool "Enable status LED commands"
 
index a1432a53440e0a1754e6b436a67de3c8fbd869e4..1e2f83cca93fd91d06c6b06a8ef923d6040b12ad 100644 (file)
@@ -50,21 +50,3 @@ void __led_toggle(led_id_t mask)
 {
        gpio_set_value(mask, !gpio_get_value(mask));
 }
-
-#ifdef CONFIG_GPIO_LED_STUBS
-
-/* 'generic' override of colored LED stubs, to use GPIO functions instead */
-
-#ifdef CONFIG_LED_STATUS_RED
-void red_led_on(void)
-{
-       __led_set(CONFIG_LED_STATUS_RED, CONFIG_LED_STATUS_ON);
-}
-
-void red_led_off(void)
-{
-       __led_set(CONFIG_LED_STATUS_RED, CONFIG_LED_STATUS_OFF);
-}
-#endif
-
-#endif /* CONFIG_GPIO_LED_STUBS */
index 8e8b19f8c190db242972a59e30f099fa4ad0d0d0..c3ff399b1ae720009d63a5e3f7642cd677c8540b 100644 (file)
@@ -65,16 +65,4 @@ static inline void status_led_set(int led, int state) { }
 static inline void status_led_boot_blink(void) { }
 
 #endif /* CONFIG_LED_STATUS    */
-
-/*
- * Coloured LEDs API
- */
-#ifndef        __ASSEMBLY__
-void red_led_on(void);
-void red_led_off(void);
-#else
-       .extern red_led_on
-       .extern red_led_off
-#endif
-
 #endif /* _STATUS_LED_H_       */