[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220408045908.21671-3-rex-bc.chen@mediatek.com>
Date: Fri, 8 Apr 2022 12:58:55 +0800
From: Rex-BC Chen <rex-bc.chen@...iatek.com>
To: <rafael@...nel.org>, <viresh.kumar@...aro.org>,
<robh+dt@...nel.org>, <krzk+dt@...nel.org>
CC: <matthias.bgg@...il.com>, <jia-wei.chang@...iatek.com>,
<roger.lu@...iatek.com>, <hsinyi@...gle.com>,
<linux-pm@...r.kernel.org>, <devicetree@...r.kernel.org>,
<linux-kernel@...r.kernel.org>,
<linux-arm-kernel@...ts.infradead.org>,
<linux-mediatek@...ts.infradead.org>,
<Project_Global_Chrome_Upstream_Group@...iatek.com>
Subject: [PATCH V2 02/15] cpufreq: mediatek: Use module_init and add module_exit
From: Jia-Wei Chang <jia-wei.chang@...iatek.com>
- Use module_init instead of device_initcall.
- Add a function for module_exit to unregister driver.
Signed-off-by: Jia-Wei Chang <jia-wei.chang@...iatek.com>
---
drivers/cpufreq/mediatek-cpufreq.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/drivers/cpufreq/mediatek-cpufreq.c b/drivers/cpufreq/mediatek-cpufreq.c
index 866163883b48..9d7d9c8dc184 100644
--- a/drivers/cpufreq/mediatek-cpufreq.c
+++ b/drivers/cpufreq/mediatek-cpufreq.c
@@ -580,7 +580,13 @@ static int __init mtk_cpufreq_driver_init(void)
return 0;
}
-device_initcall(mtk_cpufreq_driver_init);
+module_init(mtk_cpufreq_driver_init)
+
+static void __exit mtk_cpufreq_driver_exit(void)
+{
+ platform_driver_unregister(&mtk_cpufreq_platdrv);
+}
+module_exit(mtk_cpufreq_driver_exit)
MODULE_DESCRIPTION("MediaTek CPUFreq driver");
MODULE_AUTHOR("Pi-Cheng Chen <pi-cheng.chen@...aro.org>");
--
2.18.0
Powered by blists - more mailing lists