aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRasmus Villemoes <rasmus.villemoes@prevas.dk>2023-11-17 12:38:06 +0100
committerTom Rini <trini@konsulko.com>2023-12-13 11:34:49 -0500
commit5bf61f918df2140bec16ef574afe8b1490738df3 (patch)
treeebe43c5175bc006ec241b9ceb9f7835fcf21d399
parentae7ec8b0be41b59ef323f7531c0fe6745e8fef45 (diff)
led-uclass: honour ->label field populated by driver's own .bind
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>
-rw-r--r--drivers/led/led-uclass.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/led/led-uclass.c b/drivers/led/led-uclass.c
index 68ca3c2970..009f108019 100644
--- a/drivers/led/led-uclass.c
+++ b/drivers/led/led-uclass.c
@@ -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));