aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorMikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>2024-07-19 13:12:11 +0400
committerTom Rini <trini@konsulko.com>2024-07-30 12:35:23 -0600
commit2a15c676fa3413e7995e2a8b47e8932300e9e70b (patch)
tree68807c039afc26f83cf2e83a3fbfe7b01a6d4a6d /drivers
parentcb0b7ab607aa71ae4b77a2b4d30d3d604c8324af (diff)
downloadu-boot-2a15c676fa3413e7995e2a8b47e8932300e9e70b.tar.gz
led: enable LEDST_BLINK state unconditionally
Changes: * enable LEDST_BLINK state unconditionally * function led_set_period() becomes available when CONFIG_LED_BLINK is disabled. This makes led code simpler. * fix cmd/led.c to work properly when LEDST_BLINK present, but CONFIG_LED_BLINK is disabled Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu> Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/led/led-uclass.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/led/led-uclass.c b/drivers/led/led-uclass.c
index f37bf6a1550..4932b901142 100644
--- a/drivers/led/led-uclass.c
+++ b/drivers/led/led-uclass.c
@@ -71,17 +71,17 @@ enum led_state_t led_get_state(struct udevice *dev)
return ops->get_state(dev);
}
-#ifdef CONFIG_LED_BLINK
int led_set_period(struct udevice *dev, int period_ms)
{
+#ifdef CONFIG_LED_BLINK
struct led_ops *ops = led_get_ops(dev);
- if (!ops->set_period)
- return -ENOSYS;
+ if (ops->set_period)
+ return ops->set_period(dev, period_ms);
+#endif
- return ops->set_period(dev, period_ms);
+ return -ENOSYS;
}
-#endif
static int led_post_bind(struct udevice *dev)
{