
20 Jun
2024
20 Jun
'24
1:03 a.m.
Add a warning when an invalid Status LED ID is used to make the user aware of bad configurations.
Signed-off-by: Christian Marangi ansuelsmth@gmail.com --- drivers/misc/status_led.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/misc/status_led.c b/drivers/misc/status_led.c index 2b904bfa9c2..7912b4a9448 100644 --- a/drivers/misc/status_led.c +++ b/drivers/misc/status_led.c @@ -105,8 +105,10 @@ void status_led_tick(ulong timestamp)
static led_dev_t *status_get_led_dev(int led) { - if (led < 0 || led >= MAX_LED_DEV) + if (led < 0 || led >= MAX_LED_DEV) { + printf("Invalid Status LED ID %d.", led); return NULL; + }
if (!status_led_init_done) status_led_init();
--
2.43.0