[PATCH v2 1/3] leds: Init leds class earlier

Mariusz Tkaczyk
2024-05-28T13:19:58Z

PCI subsystem is registered on subsys_initcall() same as leds class.
NPEM driver will require leds class, there is race possibility.

Register led class on arch_initcall() to avoid it.

Signed-off-by: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
---
drivers/leds/led-class.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/leds/led-class.c b/drivers/leds/led-class.c
index 24fcff682b24..bed7b6ea9b98 100644
--- a/drivers/leds/led-class.c
+++ b/drivers/leds/led-class.c
@@ -681,7 +681,7 @@ static void __exit leds_exit(void)
class_unregister(&leds_class);
}

-subsys_initcall(leds_init);
+arch_initcall(leds_init);
module_exit(leds_exit);

MODULE_AUTHOR("John Lenz, Richard Purdie");
--
2.35.3