RE: [PATCH v3 4/4] leds: Add virtualcolor LED group driver

Jonathan Brophy
2025-11-30T22:46:36Z

I have been refactoring this driver for a v4 release, but I have come up with a problem in testing with a new driver.

I have converted my driver to a complete FW node implementation, but it won't work with LEDs provided by the GPIO LEDs driver as it does not work like other LED drivers.

GPIO LEDs register using devm_led_classdev_register_ext() but thet don't create a separate device structure.
so there is no symbolic links or FW structures to read with the modern FW node functions.

The FWnode-based bus search (bus_find_device()) requires a device with dev_fwnode(), which GPIO LEDs don't have
of_led_get() and devm_of_led_get() have special handling in the LED core to work around this but then I'll be mixing FW node and OF functions in my current driver approach.

Do I keep with OF format or is it ok to mix and match as it has been done in LEDS GROUP multicolor and other drivers? As it was already pointed out in a past review and was not acceptable but there Is no real way around his problem otherwise I see.

my alternative option is to patch the led core to add fwnode_led_get() to Get LED classdev by FW node?

I'm wondering on the best approach here as every option has a drawback, or review problems.