diff mbox series

[v1] mtk-mmsys: Change mtk-mmsys & mtk-mutex to modules

Message ID 20221118063018.13520-1-yongqiang.niu@mediatek.com (mailing list archive)
State New, archived
Headers show
Series [v1] mtk-mmsys: Change mtk-mmsys & mtk-mutex to modules | expand

Commit Message

Yongqiang Niu Nov. 18, 2022, 6:30 a.m. UTC
Change mtk-mmsys & mtk-mutex to modules for gki

Signed-off-by: Yongqiang Niu <yongqiang.niu@mediatek.com>
---
 drivers/soc/mediatek/Kconfig     |  2 +-
 drivers/soc/mediatek/mtk-mmsys.c | 18 +++++++++++++++++-
 drivers/soc/mediatek/mtk-mutex.c | 17 ++++++++++++++++-
 3 files changed, 34 insertions(+), 3 deletions(-)

Comments

AngeloGioacchino Del Regno Nov. 18, 2022, 10:36 a.m. UTC | #1
Il 18/11/22 07:30, Yongqiang Niu ha scritto:
> Change mtk-mmsys & mtk-mutex to modules for gki
> 
> Signed-off-by: Yongqiang Niu <yongqiang.niu@mediatek.com>

Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Matthias Brugger Dec. 16, 2022, 1:42 p.m. UTC | #2
On 18/11/2022 11:36, AngeloGioacchino Del Regno wrote:
> Il 18/11/22 07:30, Yongqiang Niu ha scritto:
>> Change mtk-mmsys & mtk-mutex to modules for gki
>>
>> Signed-off-by: Yongqiang Niu <yongqiang.niu@mediatek.com>
> 
> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
> 
> 

Applied, thanks!
diff mbox series

Patch

diff --git a/drivers/soc/mediatek/Kconfig b/drivers/soc/mediatek/Kconfig
index 40d0cc600cae..20c77152c282 100644
--- a/drivers/soc/mediatek/Kconfig
+++ b/drivers/soc/mediatek/Kconfig
@@ -68,7 +68,7 @@  config MTK_SCPSYS_PM_DOMAINS
 	  tasks in the system.
 
 config MTK_MMSYS
-	bool "MediaTek MMSYS Support"
+	tristate "MediaTek MMSYS Support"
 	default ARCH_MEDIATEK
 	depends on HAS_IOMEM
 	help
diff --git a/drivers/soc/mediatek/mtk-mmsys.c b/drivers/soc/mediatek/mtk-mmsys.c
index f3431448e843..82443a91d7d9 100644
--- a/drivers/soc/mediatek/mtk-mmsys.c
+++ b/drivers/soc/mediatek/mtk-mmsys.c
@@ -7,6 +7,7 @@ 
 #include <linux/delay.h>
 #include <linux/device.h>
 #include <linux/io.h>
+#include <linux/module.h>
 #include <linux/of_device.h>
 #include <linux/platform_device.h>
 #include <linux/reset-controller.h>
@@ -326,4 +327,19 @@  static struct platform_driver mtk_mmsys_drv = {
 	.probe = mtk_mmsys_probe,
 };
 
-builtin_platform_driver(mtk_mmsys_drv);
+static int __init mtk_mmsys_init(void)
+{
+	return platform_driver_register(&mtk_mmsys_drv);
+}
+
+static void __exit mtk_mmsys_exit(void)
+{
+	platform_driver_unregister(&mtk_mmsys_drv);
+}
+
+module_init(mtk_mmsys_init);
+module_exit(mtk_mmsys_exit);
+
+MODULE_AUTHOR("Yongqiang Niu <yongqiang.niu@mediatek.com>");
+MODULE_DESCRIPTION("MediaTek SoC MMSYS driver");
+MODULE_LICENSE("GPL");
diff --git a/drivers/soc/mediatek/mtk-mutex.c b/drivers/soc/mediatek/mtk-mutex.c
index c1a33d52038e..84cd1a858f06 100644
--- a/drivers/soc/mediatek/mtk-mutex.c
+++ b/drivers/soc/mediatek/mtk-mutex.c
@@ -874,4 +874,19 @@  static struct platform_driver mtk_mutex_driver = {
 	},
 };
 
-builtin_platform_driver(mtk_mutex_driver);
+static int __init mtk_mutex_init(void)
+{
+	return platform_driver_register(&mtk_mutex_driver);
+}
+
+static void __exit mtk_mutex_exit(void)
+{
+	platform_driver_unregister(&mtk_mutex_driver);
+}
+
+module_init(mtk_mutex_init);
+module_exit(mtk_mutex_exit);
+
+MODULE_AUTHOR("Yongqiang Niu <yongqiang.niu@mediatek.com>");
+MODULE_DESCRIPTION("MediaTek SoC MUTEX driver");
+MODULE_LICENSE("GPL");