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.
Signed-off-by: Francois Berder <fberder@outlook.fr>
Fixes: 9e3d83301e4f ("led: toggle LED on initial SW blink")
Acked-by: Quentin Schulz <quentin.schulz@cherry.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
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;