]> git.baikalelectronics.ru Git - kernel.git/commitdiff
leds: led-core: Update fwnode with device_set_node
authorSander Vanheule <sander@svanheule.net>
Sat, 13 Nov 2021 21:11:13 +0000 (22:11 +0100)
committerPavel Machek <pavel@ucw.cz>
Wed, 12 Jan 2022 18:43:14 +0000 (19:43 +0100)
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: Sander Vanheule <sander@svanheule.net>
Signed-off-by: Pavel Machek <pavel@ucw.cz>
drivers/leds/led-class.c

index f4bb02f6e042863cd495583ce1a70d22092f8ad6..6a8ea94834fa3abf258ca33d1218d4af4e312725 100644 (file)
@@ -375,10 +375,8 @@ int led_classdev_register_ext(struct device *parent,
                mutex_unlock(&led_cdev->led_access);
                return PTR_ERR(led_cdev->dev);
        }
-       if (init_data && init_data->fwnode) {
-               led_cdev->dev->fwnode = init_data->fwnode;
-               led_cdev->dev->of_node = to_of_node(init_data->fwnode);
-       }
+       if (init_data && init_data->fwnode)
+               device_set_node(led_cdev->dev, init_data->fwnode);
 
        if (ret)
                dev_warn(parent, "Led %s renamed to %s due to name collision",