firmware: arm_ffa: Split bus and driver into distinct modules

Make the FF-A bus on its own as a distinct module initialized at
subsys_initcall level when builtin.

Keep the FF-A driver core stack, together with any configured transport,
in a different module initialized as module_init level.

FF-A drivers initialization is now changed to module_init level.

Acked-by: Sebastian Ene <sebastianene@google.com>
Link: https://lore.kernel.org/r/20240515094028.1947976-2-sudeep.holla@arm.com
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
This commit is contained in:
Sudeep Holla
2024-05-15 10:40:28 +01:00
parent 9dd15934f6
commit 18c250bd7e
4 changed files with 15 additions and 16 deletions

View File

@@ -1608,14 +1608,9 @@ static int __init ffa_init(void)
if (ret)
return ret;
ret = arm_ffa_bus_init();
if (ret)
return ret;
drv_info = kzalloc(sizeof(*drv_info), GFP_KERNEL);
if (!drv_info) {
ret = -ENOMEM;
goto ffa_bus_exit;
return -ENOMEM;
}
ret = ffa_version_check(&drv_info->version);
@@ -1676,11 +1671,9 @@ free_pages:
free_pages_exact(drv_info->rx_buffer, RXTX_BUFFER_SIZE);
free_drv_info:
kfree(drv_info);
ffa_bus_exit:
arm_ffa_bus_exit();
return ret;
}
subsys_initcall(ffa_init);
module_init(ffa_init);
static void __exit ffa_exit(void)
{
@@ -1690,7 +1683,6 @@ static void __exit ffa_exit(void)
free_pages_exact(drv_info->tx_buffer, RXTX_BUFFER_SIZE);
free_pages_exact(drv_info->rx_buffer, RXTX_BUFFER_SIZE);
kfree(drv_info);
arm_ffa_bus_exit();
}
module_exit(ffa_exit);