[PATCH] mfd: Convert to subsys_platform_driver()

From: Peng Fan (OSS)

Date: Wed Nov 04 2026 - 06:42:03 EST


From: Peng Fan <peng.fan@xxxxxxx>

Replace the open-coded subsys_initcall()/module_exit() platform driver
registration with subsys_platform_driver().

No functional change.

Signed-off-by: Peng Fan <peng.fan@xxxxxxx>
---
drivers/mfd/qcom-pm8xxx.c | 13 +------------
drivers/mfd/tps65911-comparator.c | 13 +------------
2 files changed, 2 insertions(+), 24 deletions(-)

diff --git a/drivers/mfd/qcom-pm8xxx.c b/drivers/mfd/qcom-pm8xxx.c
index 0cf374c015ce..e1e236239fc2 100644
--- a/drivers/mfd/qcom-pm8xxx.c
+++ b/drivers/mfd/qcom-pm8xxx.c
@@ -593,18 +593,7 @@ static struct platform_driver pm8xxx_driver = {
.of_match_table = pm8xxx_id_table,
},
};
-
-static int __init pm8xxx_init(void)
-{
- return platform_driver_register(&pm8xxx_driver);
-}
-subsys_initcall(pm8xxx_init);
-
-static void __exit pm8xxx_exit(void)
-{
- platform_driver_unregister(&pm8xxx_driver);
-}
-module_exit(pm8xxx_exit);
+subsys_platform_driver(pm8xxx_driver);

MODULE_LICENSE("GPL v2");
MODULE_DESCRIPTION("PMIC 8xxx core driver");
diff --git a/drivers/mfd/tps65911-comparator.c b/drivers/mfd/tps65911-comparator.c
index cc8545a972bc..59ca6f475402 100644
--- a/drivers/mfd/tps65911-comparator.c
+++ b/drivers/mfd/tps65911-comparator.c
@@ -156,18 +156,7 @@ static struct platform_driver tps65911_comparator_driver = {
.probe = tps65911_comparator_probe,
.remove = tps65911_comparator_remove,
};
-
-static int __init tps65911_comparator_init(void)
-{
- return platform_driver_register(&tps65911_comparator_driver);
-}
-subsys_initcall(tps65911_comparator_init);
-
-static void __exit tps65911_comparator_exit(void)
-{
- platform_driver_unregister(&tps65911_comparator_driver);
-}
-module_exit(tps65911_comparator_exit);
+subsys_platform_driver(tps65911_comparator_driver);

MODULE_AUTHOR("Jorge Eduardo Candelaria <jedu@xxxxxxxxxxxxxxx>");
MODULE_DESCRIPTION("TPS65911 comparator driver");
--
2.51.0