summaryrefslogtreecommitdiffstats
path: root/drivers/cpufreq
diff options
context:
space:
mode:
authorZhang Jianhua <chris.zjh@huawei.com>2022-08-30 16:07:32 +0800
committerViresh Kumar <viresh.kumar@linaro.org>2022-08-30 13:49:23 +0530
commit3359d52755e5bf1268d96ce7e9d6e8c1b4700225 (patch)
treed54150fe663457492700a65ce0dc9c34e7d949f4 /drivers/cpufreq
parent0612d928b7ff8c87043115f74f08cb4af1f0c4cf (diff)
downloadlinux-3359d52755e5bf1268d96ce7e9d6e8c1b4700225.tar.bz2
cpufreq: bmips-cpufreq: Use module_init and add module_exit
- Use module_init instead of device_initcall. - Add a function for module_exit to unregister driver. Signed-off-by: Zhang Jianhua <chris.zjh@huawei.com> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Diffstat (limited to 'drivers/cpufreq')
-rw-r--r--drivers/cpufreq/bmips-cpufreq.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/cpufreq/bmips-cpufreq.c b/drivers/cpufreq/bmips-cpufreq.c
index f7c23fa468f0..39221a9a187a 100644
--- a/drivers/cpufreq/bmips-cpufreq.c
+++ b/drivers/cpufreq/bmips-cpufreq.c
@@ -156,7 +156,7 @@ static struct cpufreq_driver bmips_cpufreq_driver = {
.name = BMIPS_CPUFREQ_PREFIX,
};
-static int __init bmips_cpufreq_probe(void)
+static int __init bmips_cpufreq_driver_init(void)
{
struct cpufreq_compat *cc;
struct device_node *np;
@@ -176,7 +176,13 @@ static int __init bmips_cpufreq_probe(void)
return cpufreq_register_driver(&bmips_cpufreq_driver);
}
-device_initcall(bmips_cpufreq_probe);
+module_init(bmips_cpufreq_driver_init);
+
+static void __exit bmips_cpufreq_driver_exit(void)
+{
+ cpufreq_unregister_driver(&bmips_cpufreq_driver);
+}
+module_exit(bmips_cpufreq_driver_exit);
MODULE_AUTHOR("Markus Mayer <mmayer@broadcom.com>");
MODULE_DESCRIPTION("CPUfreq driver for Broadcom BMIPS SoCs");