]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
led-uclass: honour ->label field populated by driver's own .bind
authorRasmus Villemoes <rasmus.villemoes@prevas.dk>
Fri, 17 Nov 2023 11:38:06 +0000 (12:38 +0100)
committerTom Rini <trini@konsulko.com>
Wed, 13 Dec 2023 16:34:49 +0000 (11:34 -0500)
If the driver's own .bind method has populated uc_plat->label, don't
override that. This is necessary for an upcoming driver for ti,lp5562,
where the DT binding unfortunately says to use "chan-name" and not
"label".

Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Marek Vasut <marex@denx.de>
Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
drivers/led/led-uclass.c

index 68ca3c29702bbd3818e5a32917f257ad7fd467bc..009f10801972ac4cb5ec727391c981bc87502a89 100644 (file)
@@ -71,7 +71,9 @@ static int led_post_bind(struct udevice *dev)
        struct led_uc_plat *uc_plat = dev_get_uclass_plat(dev);
        const char *default_state;
 
-       uc_plat->label = dev_read_string(dev, "label");
+       if (!uc_plat->label)
+               uc_plat->label = dev_read_string(dev, "label");
+
        if (!uc_plat->label)
                uc_plat->label = ofnode_get_name(dev_ofnode(dev));