[clocksource: timers/drivers/next] clocksource/drivers: Convert to subsys_platform_driver() sh_cmt, sh_tmu, sh_mtu2 and em_sti
From: clocksource-bot for Brian Masney
Date: Wed Nov 25 2026 - 13:19:03 EST
The following commit has been merged into the timers/drivers/next branch of clocksource:
Commit-ID: 7422d80ca3b14db74a73f972f918c6adf818f4a0
Gitweb: https://git.kernel.org/pub/scm/linux/kernel/git/daniel.lezcano/linux.git//7422d80ca3b14db74a73f972f918c6adf818f4a0
Author: Brian Masney <bmasney@xxxxxxxxxx>
AuthorDate: Thu, 05 Nov 2026 20:32:03 -05:00
Committer: Daniel Lezcano <daniel.lezcano@xxxxxxxxxx>
CommitterDate: Wed, 25 Nov 2026 17:54:08 +01:00
clocksource/drivers: Convert to subsys_platform_driver() sh_cmt, sh_tmu, sh_mtu2 and em_sti
Reduce boilerplate code in these drivers and convert them over to use
the macro subsys_platform_driver().
Signed-off-by: Brian Masney <bmasney@xxxxxxxxxx>
Signed-off-by: Daniel Lezcano <daniel.lezcano@xxxxxxxxxx>
Link: https://patch.msgid.link/20261105-clocksource-subsys-v1-1-b0b710681b66@xxxxxxxxxx
---
drivers/clocksource/em_sti.c | 13 +------------
drivers/clocksource/sh_cmt.c | 13 +------------
drivers/clocksource/sh_mtu2.c | 13 +------------
drivers/clocksource/sh_tmu.c | 13 +------------
4 files changed, 4 insertions(+), 48 deletions(-)
diff --git a/drivers/clocksource/em_sti.c b/drivers/clocksource/em_sti.c
index 1d62ed6..5cf19d9 100644
--- a/drivers/clocksource/em_sti.c
+++ b/drivers/clocksource/em_sti.c
@@ -346,18 +346,7 @@ static struct platform_driver em_sti_device_driver = {
}
};
-static int __init em_sti_init(void)
-{
- return platform_driver_register(&em_sti_device_driver);
-}
-
-static void __exit em_sti_exit(void)
-{
- platform_driver_unregister(&em_sti_device_driver);
-}
-
-subsys_initcall(em_sti_init);
-module_exit(em_sti_exit);
+subsys_platform_driver(em_sti_device_driver);
MODULE_AUTHOR("Magnus Damm");
MODULE_DESCRIPTION("Renesas Emma Mobile STI Timer Driver");
diff --git a/drivers/clocksource/sh_cmt.c b/drivers/clocksource/sh_cmt.c
index 7977507..0bca806 100644
--- a/drivers/clocksource/sh_cmt.c
+++ b/drivers/clocksource/sh_cmt.c
@@ -1168,22 +1168,11 @@ static struct platform_driver sh_cmt_device_driver = {
.id_table = sh_cmt_id_table,
};
-static int __init sh_cmt_init(void)
-{
- return platform_driver_register(&sh_cmt_device_driver);
-}
-
-static void __exit sh_cmt_exit(void)
-{
- platform_driver_unregister(&sh_cmt_device_driver);
-}
+subsys_platform_driver(sh_cmt_device_driver);
#ifdef CONFIG_SUPERH
sh_early_platform_init("earlytimer", &sh_cmt_device_driver);
#endif
-subsys_initcall(sh_cmt_init);
-module_exit(sh_cmt_exit);
-
MODULE_AUTHOR("Magnus Damm");
MODULE_DESCRIPTION("SuperH CMT Timer Driver");
diff --git a/drivers/clocksource/sh_mtu2.c b/drivers/clocksource/sh_mtu2.c
index 3aca86d..a45bf94 100644
--- a/drivers/clocksource/sh_mtu2.c
+++ b/drivers/clocksource/sh_mtu2.c
@@ -505,22 +505,11 @@ static struct platform_driver sh_mtu2_device_driver = {
.id_table = sh_mtu2_id_table,
};
-static int __init sh_mtu2_init(void)
-{
- return platform_driver_register(&sh_mtu2_device_driver);
-}
-
-static void __exit sh_mtu2_exit(void)
-{
- platform_driver_unregister(&sh_mtu2_device_driver);
-}
+subsys_platform_driver(sh_mtu2_device_driver);
#ifdef CONFIG_SUPERH
sh_early_platform_init("earlytimer", &sh_mtu2_device_driver);
#endif
-subsys_initcall(sh_mtu2_init);
-module_exit(sh_mtu2_exit);
-
MODULE_AUTHOR("Magnus Damm");
MODULE_DESCRIPTION("SuperH MTU2 Timer Driver");
diff --git a/drivers/clocksource/sh_tmu.c b/drivers/clocksource/sh_tmu.c
index 8b3cfa6..38bfbe8 100644
--- a/drivers/clocksource/sh_tmu.c
+++ b/drivers/clocksource/sh_tmu.c
@@ -636,22 +636,11 @@ static struct platform_driver sh_tmu_device_driver = {
.id_table = sh_tmu_id_table,
};
-static int __init sh_tmu_init(void)
-{
- return platform_driver_register(&sh_tmu_device_driver);
-}
-
-static void __exit sh_tmu_exit(void)
-{
- platform_driver_unregister(&sh_tmu_device_driver);
-}
+subsys_platform_driver(sh_tmu_device_driver);
#ifdef CONFIG_SUPERH
sh_early_platform_init("earlytimer", &sh_tmu_device_driver);
#endif
-subsys_initcall(sh_tmu_init);
-module_exit(sh_tmu_exit);
-
MODULE_AUTHOR("Magnus Damm");
MODULE_DESCRIPTION("SuperH TMU Timer Driver");