Commit 495b8966 authored by Sander Vanheule's avatar Sander Vanheule Committed by Pavel Machek

leds: led-core: Update fwnode with device_set_node

Update a newly created device's fwnode and of_node pointers using the
recently added device_set_node helper. This keeps some firmware node
specifics out of led-class and should help tracking future changes
regarding device firmware node updates.
Signed-off-by: default avatarSander Vanheule <sander@svanheule.net>
Signed-off-by: default avatarPavel Machek <pavel@ucw.cz>
parent fa019ba4
...@@ -375,10 +375,8 @@ int led_classdev_register_ext(struct device *parent, ...@@ -375,10 +375,8 @@ int led_classdev_register_ext(struct device *parent,
mutex_unlock(&led_cdev->led_access); mutex_unlock(&led_cdev->led_access);
return PTR_ERR(led_cdev->dev); return PTR_ERR(led_cdev->dev);
} }
if (init_data && init_data->fwnode) { if (init_data && init_data->fwnode)
led_cdev->dev->fwnode = init_data->fwnode; device_set_node(led_cdev->dev, init_data->fwnode);
led_cdev->dev->of_node = to_of_node(init_data->fwnode);
}
if (ret) if (ret)
dev_warn(parent, "Led %s renamed to %s due to name collision", dev_warn(parent, "Led %s renamed to %s due to name collision",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment