[PATCH v1 02/11] board: st: Update LED management for stm32mp1
    Patrice Chotard 
    patrice.chotard at foss.st.com
       
    Thu Oct  9 15:53:56 CEST 2025
    
    
  
Remove get_led() and setup_led() which became obsolete since
led_boot_on() introduction. led_boot_on() is automatically called
from board_r.c
Signed-off-by: Patrice Chotard <patrice.chotard at foss.st.com>
---
 board/st/stm32mp1/stm32mp1.c | 45 ++++--------------------------------
 1 file changed, 4 insertions(+), 41 deletions(-)
diff --git a/board/st/stm32mp1/stm32mp1.c b/board/st/stm32mp1/stm32mp1.c
index cb5cab9f36a..af681dd82ef 100644
--- a/board/st/stm32mp1/stm32mp1.c
+++ b/board/st/stm32mp1/stm32mp1.c
@@ -247,41 +247,6 @@ int g_dnl_bind_fixup(struct usb_device_descriptor *dev, const char *name)
 }
 #endif /* CONFIG_USB_GADGET_DOWNLOAD */
 
-static int get_led(struct udevice **dev, char *led_string)
-{
-	const char *led_name;
-	int ret;
-
-	led_name = ofnode_conf_read_str(led_string);
-	if (!led_name) {
-		log_debug("could not find %s config string\n", led_string);
-		return -ENOENT;
-	}
-	ret = led_get_by_label(led_name, dev);
-	if (ret) {
-		log_debug("get=%d\n", ret);
-		return ret;
-	}
-
-	return 0;
-}
-
-static int setup_led(enum led_state_t cmd)
-{
-	struct udevice *dev;
-	int ret;
-
-	if (!CONFIG_IS_ENABLED(LED))
-		return 0;
-
-	ret = get_led(&dev, "u-boot,boot-led");
-	if (ret)
-		return ret;
-
-	ret = led_set_state(dev, cmd);
-	return ret;
-}
-
 static void __maybe_unused led_error_blink(u32 nb_blink)
 {
 	int ret;
@@ -292,9 +257,9 @@ static void __maybe_unused led_error_blink(u32 nb_blink)
 		return;
 
 	if (CONFIG_IS_ENABLED(LED)) {
-		ret = get_led(&led, "u-boot,error-led");
+		ret = led_get_by_label("led-red", &led);
 		if (!ret) {
-			/* make u-boot,error-led blinking */
+			/* make led-red blinking */
 			/* if U32_MAX and 125ms interval, for 17.02 years */
 			for (i = 0; i < 2 * nb_blink; i++) {
 				led_set_state(led, LEDST_TOGGLE);
@@ -418,7 +383,7 @@ static int board_check_usb_power(void)
 	 * If highest and lowest value are either both below
 	 * USB_LOW_THRESHOLD_UV or both above USB_LOW_THRESHOLD_UV, that
 	 * means USB TYPE-C is in unattached mode, this is an issue, make
-	 * u-boot,error-led blinking and stop boot process.
+	 * led-red blinking and stop boot process.
 	 */
 	if ((max_uV > USB_LOW_THRESHOLD_UV &&
 	     min_uV > USB_LOW_THRESHOLD_UV) ||
@@ -672,8 +637,6 @@ int board_init(void)
 	if (IS_ENABLED(CONFIG_ARMV7_NONSEC))
 		sysconf_init();
 
-	setup_led(LEDST_ON);
-
 #if IS_ENABLED(CONFIG_EFI_HAVE_CAPSULE_SUPPORT)
 	efi_guid_t image_type_guid = STM32MP_FIP_IMAGE_GUID;
 
@@ -736,7 +699,7 @@ int board_late_init(void)
 
 void board_quiesce_devices(void)
 {
-	setup_led(LEDST_OFF);
+	led_boot_off();
 }
 
 enum env_location env_get_location(enum env_operation op, int prio)
-- 
2.43.0
    
    
More information about the U-Boot
mailing list