Skip to content

Commit

Permalink
leds: lm3532: use extended registration so that LED can be used for b…
Browse files Browse the repository at this point in the history
…acklight

Signed-off-by: Pavel Machek <[email protected]>
  • Loading branch information
pavelmachek committed Jan 4, 2020
1 parent 867b682 commit cf6eb52
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion drivers/leds/leds-lm3532.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit cf6eb52

Please sign in to comment.