leds: regulator: Make probeable from device tree
authorLinus Walleij <linus.walleij@linaro.org>
Mon, 4 Apr 2022 20:35:22 +0000 (22:35 +0200)
committerPavel Machek <pavel@ucw.cz>
Thu, 5 May 2022 08:04:52 +0000 (10:04 +0200)
commit835fc89e249e07ec5c1587a297e30db8f2adcea3
treedc956a5a1262a7651b2c853f0df6da22049a4452
parent4c350c658f946dae81dbbaff25da0a03e9bb0c4b
leds: regulator: Make probeable from device tree

The regulator LED can easily be adapted to probe from the
device tree.

We switch led_classdev_register() to led_classdev_register_ext()
passing some struct led_init_data init_data that we leave NULL
save the fwnode if platform data isn't present so that it will be
populated from the device tree.

If we have platform data we set up the name from the platform
data but using init_data instead.

Cc: Antonio Ospite <ao2@ao2.it>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Pavel Machek <pavel@ucw.cz>
drivers/leds/leds-regulator.c