summaryrefslogtreecommitdiff
path: root/drivers/led
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/led')
-rw-r--r--drivers/led/led-uclass.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/led/led-uclass.c b/drivers/led/led-uclass.c
index 7e298dbb06..2f4aa18fb1 100644
--- a/drivers/led/led-uclass.c
+++ b/drivers/led/led-uclass.c
@@ -95,8 +95,20 @@ int led_default_state(void)
return ret;
}
+static int led_post_bind(struct udevice *dev)
+{
+ struct led_uc_plat *uc_plat = dev_get_uclass_plat(dev);
+
+ uc_plat->label = dev_read_string(dev, "label");
+ if (!uc_plat->label)
+ uc_plat->label = ofnode_get_name(dev_ofnode(dev));
+
+ return 0;
+}
+
UCLASS_DRIVER(led) = {
.id = UCLASS_LED,
.name = "led",
.per_device_plat_auto = sizeof(struct led_uc_plat),
+ .post_bind = led_post_bind,
};