[PATCH 2/3] led: Mark device instance with DM_FLAG_PROBE_AFTER_BIND

Marek Vasut marex at denx.de
Mon Apr 25 18:43:40 CEST 2022


On 4/25/22 16:31, Tom Rini wrote:
> On Fri, Apr 22, 2022 at 03:15:54PM +0200, Marek Vasut wrote:
> 
>> 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 <marex at denx.de>
>> Cc: Patrice Chotard <patrice.chotard at foss.st.com>
>> Cc: Patrick Delaunay <patrick.delaunay at foss.st.com>
>> Cc: Sean Anderson <seanga2 at gmail.com>
>> Cc: Simon Glass <sjg at chromium.org>
>> Cc: Steven Lawrance <steven.lawrance at softathome.com>
>> Reviewed-by: Patrice Chotard <patrice.chotard at foss.st.com>
>> Tested-by: Patrice Chotard <patrice.chotard at foss.st.com>
>> ---
>>   drivers/led/led-uclass.c | 4 +++-
>>   1 file changed, 3 insertions(+), 1 deletion(-)
> 
> This breaks all of the sandbox tests, which perhaps need another update
> for what you've changed here?  I already had to tweak them once in
> 72675b063b6e ("led: Configure LED default-state on boot").  But my
> perhaps incorrect read then was that the dts / test weren't quite right
> to start with.  Perhaps that's still the case however?

Pick these two test fixes:

[PATCH 1/2] test: dm: led: Fix LED enumeration
[PATCH 2/2] test: dm: pinmux: Get LED2 udevice in the pinmux test


More information about the U-Boot mailing list