led-uclass: do not create fallback label for top-level node
Many existing drivers, and led-uclass itself, rely on uc_plat->label being NULL for the device representing the top node, as opposed to the child nodes representing individual LEDs. This means that the drivers whose .probe methods rely on this were broken by commit 83c63f0d ("led: Move OF "label" property parsing to core"), and also that the top node wrongly shows up with 'led list'. Binding the same driver to the top node as to the individual child nodes is arguably wrong, and the approach of using a UCLASS_NOP driver for the top node is probably better - this has for example been done in commit 01074697 ("led: gpio: Use NOP uclass driver for top-level node") and commit 910b01c2 ("drivers: led: bcm6753: do not use null label to find the top") Until remaining affected drivers are fixed, we can use a heuristic that only sets the label to the fallback value derived from the node name if the node does not have a "compatible" property - i.e., if it has been bound to the LED driver explicitly via device_bind_driver_to_node(). This is similar to what commit e3aa7664 ("led: gpio: Check device compatible string to determine the top level node") did for gpio_led, but that fix was then supplanted by commit 01074697 ("led: gpio: Use NOP uclass driver for top-level node") Fixes: 83c63f0d ("led: Move OF "label" property parsing to core") Signed-off-by:Rasmus Villemoes <rasmus.villemoes@prevas.dk>
Loading
Please register or sign in to comment