mbox series

[0/2] leds: trigger: load trigger modules on-demand if used as default trigger

Message ID 72c8b297-72a9-493e-a8fa-cc37ee460cf1@gmail.com
Headers show
Series leds: trigger: load trigger modules on-demand if used as default trigger | expand

Message

Heiner Kallweit Dec. 21, 2023, 10:18 p.m. UTC
Even if a trigger is set as default trigger for a LED device,
the respective trigger module (if built as module) isn't automatically
loaded by the kernel if the LED device is registered. I think we can
do better. Try to load the module asynchronously by alias
ledtrig:<trigger name>. This requires that such an alias is added to
relevant triggers. At first do this for the netdev trigger.

Tested with the recently added r8169 LED support using the netdev
trigger.

Heiner Kallweit (2):
  leds: trigger: load trigger modules on-demand if used as default
    trigger
  leds: trigger: netdev: Add module alias ledtrig:netdev

 drivers/leds/led-triggers.c           | 9 +++++++++
 drivers/leds/trigger/ledtrig-netdev.c | 1 +
 2 files changed, 10 insertions(+)

Comments

Lee Jones Jan. 11, 2024, 10:23 a.m. UTC | #1
On Thu, 21 Dec 2023 23:18:13 +0100, Heiner Kallweit wrote:
> Even if a trigger is set as default trigger for a LED device,
> the respective trigger module (if built as module) isn't automatically
> loaded by the kernel if the LED device is registered. I think we can
> do better. Try to load the module asynchronously by alias
> ledtrig:<trigger name>. This requires that such an alias is added to
> relevant triggers. At first do this for the netdev trigger.
> 
> [...]

Applied, thanks!

[1/2] leds: trigger: load trigger modules on-demand if used as default trigger
      commit: 5edf7f11313d99dc96d30b5d99b68e56d7c3d4e1
[2/2] leds: trigger: netdev: Add module alias ledtrig:netdev
      commit: defaca9f7cfb27681064e20f4aaa8dcf4dc09590

--
Lee Jones [李琼斯]