Skip to contentSkip to conversation

fpga: dfl: use subsys_initcall to allow built-in drivers to be added

PATCH Applied Thadeu Lima de Souza Cascardo 2 participants 2 messages Dec 15, 2025 – Dec 19, 2025

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fpga: dfl: use subsys_initcall to allow built-in drivers to be added

The dfl code adds a bus. If it is built-in and there is a built-in driver as well, the dfl module_init may be called after the driver module_init, leading to a failure to register the driver as the bus has not been added yet.

Use subsys_initcall, which guarantees it will be called before the drivers init code.

Without the fix, we see failures like this:

[    0.479475] Driver 'intel-m10-bmc' was unable to register with bus_type 'dfl' because the bus was not initialized.
Fixes 9ba3a0aa09fe ("fpga: dfl: create a dfl bus type to support DFL devices")
---
 drivers/fpga/dfl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/fpga/dfl.c +1 -1
index 7022657243c0a72bda2013386c66fb8bafe4b380..449c3a082e232b2814c136c7b2f36e75f2ba1aa3 100644
@@ -2018,7 +2018,7 @@ static void __exit dfl_fpga_exit(void)
 	bus_unregister(&dfl_bus_type);
 }
 
-module_init(dfl_fpga_init);
+subsys_initcall(dfl_fpga_init);
 module_exit(dfl_fpga_exit);
 
 MODULE_DESCRIPTION("FPGA Device Feature List (DFL) Support");

---
base-commit: 8f0b4cce4481fb22653697cced8d0d04027cb1e8
change-id: 20251215-dfl_subsys-d37c77285572

Best regards,

Signature · 1 line
Thadeu Lima de Souza Cascardo <[email protected]>
Reviewed-by on v1 1/1 Applied
#1 lore raw
Quoted 5 lines · Thadeu Lima de Souza Cascardo

The dfl code adds a bus. If it is built-in and there is a built-in driver as well, the dfl module_init may be called after the driver module_init, leading to a failure to register the driver as the bus has not been added yet.

Quoted 8 lines

Use subsys_initcall, which guarantees it will be called before the drivers init code.

Without the fix, we see failures like this:

[    0.479475] Driver 'intel-m10-bmc' was unable to register with bus_type 'dfl' because the bus was not initialized.
Fixes 9ba3a0aa09fe ("fpga: dfl: create a dfl bus type to support DFL devices")

I will add:

Quoted 1 line

Applied to for-next, thanks.