[PATCH] led: Fix toggling LED on initial SW blink

Quentin Schulz quentin.schulz at cherry.de
Mon May 11 15:07:02 CEST 2026


Hi Francois,

On 5/9/26 7:30 PM, Francois Berder wrote:
> If the LED is in the ON state, it is briefly set to OFF
> then to ON immediately due to falling-through in the default
> case.
> This commit ensures that no fall-through occurs and thus
> a LED initially in the ON state is turned off before blinking.
> 

Fixes: 9e3d83301e4f ("led: toggle LED on initial SW blink")

Adding Christian in Cc so they may provide additional context if needed 
if this isn't the proper fix for some reason.

Acked-by: Quentin Schulz <quentin.schulz at cherry.de>

Thanks!
Quentin

> Signed-off-by: Francois Berder <fberder at outlook.fr>
> ---
>   drivers/led/led_sw_blink.c | 2 ++
>   1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/led/led_sw_blink.c b/drivers/led/led_sw_blink.c
> index ee1546d02d4..4190fde8f0f 100644
> --- a/drivers/led/led_sw_blink.c
> +++ b/drivers/led/led_sw_blink.c
> @@ -114,9 +114,11 @@ bool led_sw_on_state_change(struct udevice *dev, enum led_state_t state)
>   		case LEDST_ON:
>   			ops->set_state(dev, LEDST_OFF);
>   			sw_blink->state = LED_SW_BLINK_ST_OFF;
> +			break;
>   		default:
>   			ops->set_state(dev, LEDST_ON);
>   			sw_blink->state = LED_SW_BLINK_ST_ON;
> +			break;
>   		}
>   
>   		return true;



More information about the U-Boot mailing list