diff options
author | Sudeep Holla <sudeep.holla@arm.com> | 2020-09-07 14:00:04 +0300 |
---|---|---|
committer | Sudeep Holla <sudeep.holla@arm.com> | 2020-09-14 09:30:48 +0300 |
commit | 5a2f0a0bdf201e2183904b6217f9c74774c961a8 (patch) | |
tree | 19ee6ac86e17c40fe37b0bf5906b38ce18c544db /drivers/firmware/arm_scmi/driver.c | |
parent | 6825f17c950ca5691a057fa71bb1b649b7434014 (diff) | |
download | linux-5a2f0a0bdf201e2183904b6217f9c74774c961a8.tar.xz |
firmware: arm_scmi: Move scmi bus init and exit calls into the driver
In preparation to enable building scmi as a single module, let us move
the scmi bus {de-,}initialisation call into the driver.
The main reason for this is to keep it simple instead of maintaining
it as separate modules and dealing with all possible initcall races
and deferred probe handling. We can move it as separate modules if
needed in future.
Link: https://lore.kernel.org/r/20200907195046.56615-3-sudeep.holla@arm.com
Tested-by: Cristian Marussi <cristian.marussi@arm.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
Diffstat (limited to 'drivers/firmware/arm_scmi/driver.c')
-rw-r--r-- | drivers/firmware/arm_scmi/driver.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/drivers/firmware/arm_scmi/driver.c b/drivers/firmware/arm_scmi/driver.c index dbec34423f72..8f60c6a97cc3 100644 --- a/drivers/firmware/arm_scmi/driver.c +++ b/drivers/firmware/arm_scmi/driver.c @@ -929,7 +929,21 @@ static struct platform_driver scmi_driver = { .remove = scmi_remove, }; -module_platform_driver(scmi_driver); +static int __init scmi_driver_init(void) +{ + scmi_bus_init(); + + return platform_driver_register(&scmi_driver); +} +module_init(scmi_driver_init); + +static void __exit scmi_driver_exit(void) +{ + scmi_bus_exit(); + + platform_driver_unregister(&scmi_driver); +} +module_exit(scmi_driver_exit); MODULE_ALIAS("platform: arm-scmi"); MODULE_AUTHOR("Sudeep Holla <sudeep.holla@arm.com>"); |