From: Marek Vasut Date: Fri, 22 Apr 2022 13:15:54 +0000 (+0200) Subject: led: Mark device instance with DM_FLAG_PROBE_AFTER_BIND X-Git-Tag: v2022.07~74^2~6 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c438866b16745fc69f0f05636b9cf69b16378fca;p=platform%2Fkernel%2Fu-boot.git led: Mark device instance with DM_FLAG_PROBE_AFTER_BIND Calling device_probe() from uclass .post_bind() callback has all kinds of odd side-effects, e.g. device instances not being available just yet. Make use of the DM_FLAG_PROBE_AFTER_BIND instead, mark device instances which need to be probe()d in order to configure the LED default state with this flag and let the DM core do the device_probe() at the right time instead. Fixes: 72675b063b6 ("led: Configure LED default-state on boot") Signed-off-by: Marek Vasut Cc: Patrice Chotard Cc: Patrick Delaunay Cc: Sean Anderson Cc: Simon Glass Cc: Steven Lawrance Reviewed-by: Patrice Chotard Tested-by: Patrice Chotard --- diff --git a/drivers/led/led-uclass.c b/drivers/led/led-uclass.c index 5d7bf40..2ce7293 100644 --- a/drivers/led/led-uclass.c +++ b/drivers/led/led-uclass.c @@ -98,7 +98,9 @@ static int led_post_bind(struct udevice *dev) * In case the LED has default-state DT property, trigger * probe() to configure its default state during startup. */ - return device_probe(dev); + dev_or_flags(dev, DM_FLAG_PROBE_AFTER_BIND); + + return 0; } static int led_post_probe(struct udevice *dev)