mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-08 11:50:43 +09:00
UPSTREAM: 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
Change-Id: I6f1a6ce7cc4c2b6f281add5f5d6a7ca3cbad9eca
Tested-by: Cristian Marussi <cristian.marussi@arm.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
(cherry picked from commit 5a2f0a0bdf)
This commit is contained in:
@@ -221,7 +221,7 @@ static void scmi_devices_unregister(void)
|
||||
bus_for_each_dev(&scmi_bus_type, NULL, NULL, __scmi_devices_unregister);
|
||||
}
|
||||
|
||||
static int __init scmi_bus_init(void)
|
||||
int __init scmi_bus_init(void)
|
||||
{
|
||||
int retval;
|
||||
|
||||
@@ -231,12 +231,10 @@ static int __init scmi_bus_init(void)
|
||||
|
||||
return retval;
|
||||
}
|
||||
subsys_initcall(scmi_bus_init);
|
||||
|
||||
static void __exit scmi_bus_exit(void)
|
||||
void __exit scmi_bus_exit(void)
|
||||
{
|
||||
scmi_devices_unregister();
|
||||
bus_unregister(&scmi_bus_type);
|
||||
ida_destroy(&scmi_bus_id);
|
||||
}
|
||||
module_exit(scmi_bus_exit);
|
||||
|
||||
@@ -152,6 +152,9 @@ void scmi_setup_protocol_implemented(const struct scmi_handle *handle,
|
||||
|
||||
int scmi_base_protocol_init(struct scmi_handle *h);
|
||||
|
||||
int __init scmi_bus_init(void);
|
||||
void __exit scmi_bus_exit(void);
|
||||
|
||||
/* SCMI Transport */
|
||||
/**
|
||||
* struct scmi_chan_info - Structure representing a SCMI channel information
|
||||
|
||||
@@ -797,7 +797,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>");
|
||||
|
||||
Reference in New Issue
Block a user