Then there is no need to set np or store it. Signed-off-by: Oleh Kravchenko <oleg@xxxxxxxxxx> --- drivers/leds/leds-cr0014114.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/drivers/leds/leds-cr0014114.c b/drivers/leds/leds-cr0014114.c index 91deb40db307..880089ef9a9b 100644 --- a/drivers/leds/leds-cr0014114.c +++ b/drivers/leds/leds-cr0014114.c @@ -183,12 +183,10 @@ static int cr0014114_probe_dt(struct cr0014114 *priv) size_t i = 0; struct cr0014114_led *led; struct fwnode_handle *child; - struct device_node *np; int ret; const char *str; device_for_each_child_node(priv->dev, child) { - np = to_of_node(child); led = &priv->leds[i]; ret = fwnode_property_read_string(child, "label", &str); @@ -207,8 +205,7 @@ static int cr0014114_probe_dt(struct cr0014114 *priv) led->ldev.max_brightness = CR_MAX_BRIGHTNESS; led->ldev.brightness_set_blocking = cr0014114_set_sync; - ret = devm_of_led_classdev_register(priv->dev, np, - &led->ldev); + ret = devm_led_classdev_register(priv->dev, &led->ldev); if (ret) { dev_err(priv->dev, "failed to register LED device %s, err %d", @@ -217,8 +214,6 @@ static int cr0014114_probe_dt(struct cr0014114 *priv) return ret; } - led->ldev.dev->of_node = np; - i++; } -- 2.21.0