summaryrefslogtreecommitdiffstats
path: root/drivers/leds
diff options
context:
space:
mode:
authorPavel <pavel@ucw.cz>2019-08-07 12:43:52 +0200
committerPavel <pavel@ucw.cz>2020-01-04 18:51:42 +0100
commitcf6eb52fa3d0ff0414f3dfcfbd40bd57f3bbd679 (patch)
treef0863424af4a44d272d565480f078e5e7aa3bde2 /drivers/leds
parent867b682459208dc3e18d3ab69f35da0064943889 (diff)
downloadlinux-cf6eb52fa3d0ff0414f3dfcfbd40bd57f3bbd679.tar.bz2
leds: lm3532: use extended registration so that LED can be used for backlight
Signed-off-by: Pavel Machek <pavel@ucw.cz>
Diffstat (limited to 'drivers/leds')
-rw-r--r--drivers/leds/leds-lm3532.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/leds/leds-lm3532.c b/drivers/leds/leds-lm3532.c
index 0507c6575c08..23f49b6d1925 100644
--- a/drivers/leds/leds-lm3532.c
+++ b/drivers/leds/leds-lm3532.c
@@ -577,6 +577,12 @@ static int lm3532_parse_node(struct lm3532_data *priv)
priv->runtime_ramp_down = lm3532_get_ramp_index(ramp_time);
device_for_each_child_node(priv->dev, child) {
+ struct led_init_data idata = {
+ .fwnode = child,
+ .default_label = ":",
+ .devicename = priv->client->name,
+ };
+
led = &priv->leds[i];
ret = fwnode_property_read_u32(child, "reg", &control_bank);
@@ -651,7 +657,7 @@ static int lm3532_parse_node(struct lm3532_data *priv)
led->led_dev.name = led->label;
led->led_dev.brightness_set_blocking = lm3532_brightness_set;
- ret = devm_led_classdev_register(priv->dev, &led->led_dev);
+ ret = devm_led_classdev_register_ext(priv->dev, &led->led_dev, &idata);
if (ret) {
dev_err(&priv->client->dev, "led register err: %d\n",
ret);