mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] regulator: Convert to subsys_platform_driver()
@ 2026-11-04 11:33 Peng Fan (OSS)
  2026-11-04 11:49 ` Charles Keepax
  0 siblings, 1 reply; 2+ messages in thread
From: Peng Fan (OSS) @ 2026-11-04 11:33 UTC (permalink / raw)
  To: Liam Girdwood, Mark Brown, Support Opensource, Chanwoo Choi,
	Krzysztof Kozlowski, Aaro Koskinen, Andreas Kemnade,
	Kevin Hilman, Roger Quadros, Tony Lindgren
  Cc: linux-kernel, linux-omap, patches

From: Peng Fan <peng.fan@nxp.com>

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@nxp.com>
---
 drivers/regulator/88pm8607.c           | 13 +------------
 drivers/regulator/aat2870-regulator.c  | 13 +------------
 drivers/regulator/as3711-regulator.c   | 13 +------------
 drivers/regulator/da903x-regulator.c   | 13 +------------
 drivers/regulator/da9052-regulator.c   | 13 +------------
 drivers/regulator/da9055-regulator.c   | 13 +------------
 drivers/regulator/da9062-regulator.c   | 13 +------------
 drivers/regulator/da9063-regulator.c   | 13 +------------
 drivers/regulator/fixed.c              | 13 +------------
 drivers/regulator/gpio-regulator.c     | 13 +------------
 drivers/regulator/lp8788-buck.c        | 13 +------------
 drivers/regulator/max77693-regulator.c | 13 +------------
 drivers/regulator/max8907-regulator.c  | 14 +-------------
 drivers/regulator/max8925-regulator.c  | 13 +------------
 drivers/regulator/max8997-regulator.c  | 13 +------------
 drivers/regulator/max8998.c            | 13 +------------
 drivers/regulator/mc13783-regulator.c  | 13 +------------
 drivers/regulator/mc13892-regulator.c  | 13 +------------
 drivers/regulator/palmas-regulator.c   | 13 +------------
 drivers/regulator/rc5t583-regulator.c  | 13 +------------
 drivers/regulator/tps6105x-regulator.c | 13 +------------
 drivers/regulator/tps6507x-regulator.c | 13 +------------
 drivers/regulator/tps65090-regulator.c | 13 +------------
 drivers/regulator/tps65217-regulator.c | 13 +------------
 drivers/regulator/tps6586x-regulator.c | 13 +------------
 drivers/regulator/tps65910-regulator.c | 13 +------------
 drivers/regulator/tps68470-regulator.c | 12 +-----------
 drivers/regulator/wm8350-regulator.c   | 13 +------------
 drivers/regulator/wm8400-regulator.c   | 13 +------------
 29 files changed, 29 insertions(+), 348 deletions(-)

diff --git a/drivers/regulator/88pm8607.c b/drivers/regulator/88pm8607.c
index 969554725a67..b740b4883812 100644
--- a/drivers/regulator/88pm8607.c
+++ b/drivers/regulator/88pm8607.c
@@ -386,18 +386,7 @@ static struct platform_driver pm8607_regulator_driver = {
 	.probe		= pm8607_regulator_probe,
 	.id_table	= pm8607_regulator_driver_ids,
 };
-
-static int __init pm8607_regulator_init(void)
-{
-	return platform_driver_register(&pm8607_regulator_driver);
-}
-subsys_initcall(pm8607_regulator_init);
-
-static void __exit pm8607_regulator_exit(void)
-{
-	platform_driver_unregister(&pm8607_regulator_driver);
-}
-module_exit(pm8607_regulator_exit);
+subsys_platform_driver(pm8607_regulator_driver);
 
 MODULE_LICENSE("GPL");
 MODULE_AUTHOR("Haojian Zhuang <haojian.zhuang@marvell.com>");
diff --git a/drivers/regulator/aat2870-regulator.c b/drivers/regulator/aat2870-regulator.c
index 970d86f2bbb8..52c08e6c4803 100644
--- a/drivers/regulator/aat2870-regulator.c
+++ b/drivers/regulator/aat2870-regulator.c
@@ -182,18 +182,7 @@ static struct platform_driver aat2870_regulator_driver = {
 	},
 	.probe	= aat2870_regulator_probe,
 };
-
-static int __init aat2870_regulator_init(void)
-{
-	return platform_driver_register(&aat2870_regulator_driver);
-}
-subsys_initcall(aat2870_regulator_init);
-
-static void __exit aat2870_regulator_exit(void)
-{
-	platform_driver_unregister(&aat2870_regulator_driver);
-}
-module_exit(aat2870_regulator_exit);
+subsys_platform_driver(aat2870_regulator_driver);
 
 MODULE_DESCRIPTION("AnalogicTech AAT2870 Regulator");
 MODULE_LICENSE("GPL");
diff --git a/drivers/regulator/as3711-regulator.c b/drivers/regulator/as3711-regulator.c
index 0431a732cd78..22fa51ce22ee 100644
--- a/drivers/regulator/as3711-regulator.c
+++ b/drivers/regulator/as3711-regulator.c
@@ -247,18 +247,7 @@ static struct platform_driver as3711_regulator_driver = {
 	},
 	.probe		= as3711_regulator_probe,
 };
-
-static int __init as3711_regulator_init(void)
-{
-	return platform_driver_register(&as3711_regulator_driver);
-}
-subsys_initcall(as3711_regulator_init);
-
-static void __exit as3711_regulator_exit(void)
-{
-	platform_driver_unregister(&as3711_regulator_driver);
-}
-module_exit(as3711_regulator_exit);
+subsys_platform_driver(as3711_regulator_driver);
 
 MODULE_AUTHOR("Guennadi Liakhovetski <g.liakhovetski@gmx.de>");
 MODULE_DESCRIPTION("AS3711 regulator driver");
diff --git a/drivers/regulator/da903x-regulator.c b/drivers/regulator/da903x-regulator.c
index 2f85897183b3..05629667dfc3 100644
--- a/drivers/regulator/da903x-regulator.c
+++ b/drivers/regulator/da903x-regulator.c
@@ -475,18 +475,7 @@ static struct platform_driver da903x_regulator_driver = {
 	},
 	.probe		= da903x_regulator_probe,
 };
-
-static int __init da903x_regulator_init(void)
-{
-	return platform_driver_register(&da903x_regulator_driver);
-}
-subsys_initcall(da903x_regulator_init);
-
-static void __exit da903x_regulator_exit(void)
-{
-	platform_driver_unregister(&da903x_regulator_driver);
-}
-module_exit(da903x_regulator_exit);
+subsys_platform_driver(da903x_regulator_driver);
 
 MODULE_LICENSE("GPL");
 MODULE_AUTHOR("Eric Miao <eric.miao@marvell.com>"
diff --git a/drivers/regulator/da9052-regulator.c b/drivers/regulator/da9052-regulator.c
index fbebe538a648..412eb27c1067 100644
--- a/drivers/regulator/da9052-regulator.c
+++ b/drivers/regulator/da9052-regulator.c
@@ -441,18 +441,7 @@ static struct platform_driver da9052_regulator_driver = {
 		.probe_type = PROBE_PREFER_ASYNCHRONOUS,
 	},
 };
-
-static int __init da9052_regulator_init(void)
-{
-	return platform_driver_register(&da9052_regulator_driver);
-}
-subsys_initcall(da9052_regulator_init);
-
-static void __exit da9052_regulator_exit(void)
-{
-	platform_driver_unregister(&da9052_regulator_driver);
-}
-module_exit(da9052_regulator_exit);
+subsys_platform_driver(da9052_regulator_driver);
 
 MODULE_AUTHOR("David Dajun Chen <dchen@diasemi.com>");
 MODULE_DESCRIPTION("Power Regulator driver for Dialog DA9052 PMIC");
diff --git a/drivers/regulator/da9055-regulator.c b/drivers/regulator/da9055-regulator.c
index a0d3414aa79e..29756eec6502 100644
--- a/drivers/regulator/da9055-regulator.c
+++ b/drivers/regulator/da9055-regulator.c
@@ -579,18 +579,7 @@ static struct platform_driver da9055_regulator_driver = {
 		.probe_type = PROBE_PREFER_ASYNCHRONOUS,
 	},
 };
-
-static int __init da9055_regulator_init(void)
-{
-	return platform_driver_register(&da9055_regulator_driver);
-}
-subsys_initcall(da9055_regulator_init);
-
-static void __exit da9055_regulator_exit(void)
-{
-	platform_driver_unregister(&da9055_regulator_driver);
-}
-module_exit(da9055_regulator_exit);
+subsys_platform_driver(da9055_regulator_driver);
 
 MODULE_AUTHOR("David Dajun Chen <dchen@diasemi.com>");
 MODULE_DESCRIPTION("Power Regulator driver for Dialog DA9055 PMIC");
diff --git a/drivers/regulator/da9062-regulator.c b/drivers/regulator/da9062-regulator.c
index e0c96f10e570..7f0604327358 100644
--- a/drivers/regulator/da9062-regulator.c
+++ b/drivers/regulator/da9062-regulator.c
@@ -1036,18 +1036,7 @@ static struct platform_driver da9062_regulator_driver = {
 	},
 	.probe = da9062_regulator_probe,
 };
-
-static int __init da9062_regulator_init(void)
-{
-	return platform_driver_register(&da9062_regulator_driver);
-}
-subsys_initcall(da9062_regulator_init);
-
-static void __exit da9062_regulator_cleanup(void)
-{
-	platform_driver_unregister(&da9062_regulator_driver);
-}
-module_exit(da9062_regulator_cleanup);
+subsys_platform_driver(da9062_regulator_driver);
 
 /* Module information */
 MODULE_AUTHOR("S Twiss <stwiss.opensource@diasemi.com>");
diff --git a/drivers/regulator/da9063-regulator.c b/drivers/regulator/da9063-regulator.c
index bf34ea440d77..b4680f335961 100644
--- a/drivers/regulator/da9063-regulator.c
+++ b/drivers/regulator/da9063-regulator.c
@@ -1064,18 +1064,7 @@ static struct platform_driver da9063_regulator_driver = {
 	},
 	.probe = da9063_regulator_probe,
 };
-
-static int __init da9063_regulator_init(void)
-{
-	return platform_driver_register(&da9063_regulator_driver);
-}
-subsys_initcall(da9063_regulator_init);
-
-static void __exit da9063_regulator_cleanup(void)
-{
-	platform_driver_unregister(&da9063_regulator_driver);
-}
-module_exit(da9063_regulator_cleanup);
+subsys_platform_driver(da9063_regulator_driver);
 
 
 /* Module information */
diff --git a/drivers/regulator/fixed.c b/drivers/regulator/fixed.c
index f797cb504b9a..3f95ac2b0d29 100644
--- a/drivers/regulator/fixed.c
+++ b/drivers/regulator/fixed.c
@@ -388,18 +388,7 @@ static struct platform_driver regulator_fixed_voltage_driver = {
 		.of_match_table = of_match_ptr(fixed_of_match),
 	},
 };
-
-static int __init regulator_fixed_voltage_init(void)
-{
-	return platform_driver_register(&regulator_fixed_voltage_driver);
-}
-subsys_initcall(regulator_fixed_voltage_init);
-
-static void __exit regulator_fixed_voltage_exit(void)
-{
-	platform_driver_unregister(&regulator_fixed_voltage_driver);
-}
-module_exit(regulator_fixed_voltage_exit);
+subsys_platform_driver(regulator_fixed_voltage_driver);
 
 MODULE_AUTHOR("Mark Brown <broonie@opensource.wolfsonmicro.com>");
 MODULE_DESCRIPTION("Fixed voltage regulator");
diff --git a/drivers/regulator/gpio-regulator.c b/drivers/regulator/gpio-regulator.c
index 6351ceefdb3e..e16eedb27b1c 100644
--- a/drivers/regulator/gpio-regulator.c
+++ b/drivers/regulator/gpio-regulator.c
@@ -370,18 +370,7 @@ static struct platform_driver gpio_regulator_driver = {
 		.of_match_table = of_match_ptr(regulator_gpio_of_match),
 	},
 };
-
-static int __init gpio_regulator_init(void)
-{
-	return platform_driver_register(&gpio_regulator_driver);
-}
-subsys_initcall(gpio_regulator_init);
-
-static void __exit gpio_regulator_exit(void)
-{
-	platform_driver_unregister(&gpio_regulator_driver);
-}
-module_exit(gpio_regulator_exit);
+subsys_platform_driver(gpio_regulator_driver);
 
 MODULE_AUTHOR("Heiko Stuebner <heiko@sntech.de>");
 MODULE_DESCRIPTION("gpio voltage regulator");
diff --git a/drivers/regulator/lp8788-buck.c b/drivers/regulator/lp8788-buck.c
index 2ade249ab6df..6028c2ac11ec 100644
--- a/drivers/regulator/lp8788-buck.c
+++ b/drivers/regulator/lp8788-buck.c
@@ -522,18 +522,7 @@ static struct platform_driver lp8788_buck_driver = {
 		.probe_type = PROBE_PREFER_ASYNCHRONOUS,
 	},
 };
-
-static int __init lp8788_buck_init(void)
-{
-	return platform_driver_register(&lp8788_buck_driver);
-}
-subsys_initcall(lp8788_buck_init);
-
-static void __exit lp8788_buck_exit(void)
-{
-	platform_driver_unregister(&lp8788_buck_driver);
-}
-module_exit(lp8788_buck_exit);
+subsys_platform_driver(lp8788_buck_driver);
 
 MODULE_DESCRIPTION("TI LP8788 BUCK Driver");
 MODULE_AUTHOR("Milo Kim");
diff --git a/drivers/regulator/max77693-regulator.c b/drivers/regulator/max77693-regulator.c
index a8b3a2058d34..cfadf33574c3 100644
--- a/drivers/regulator/max77693-regulator.c
+++ b/drivers/regulator/max77693-regulator.c
@@ -286,18 +286,7 @@ static struct platform_driver max77693_pmic_driver = {
 	.probe = max77693_pmic_probe,
 	.id_table = max77693_pmic_id,
 };
-
-static int __init max77693_pmic_init(void)
-{
-	return platform_driver_register(&max77693_pmic_driver);
-}
-subsys_initcall(max77693_pmic_init);
-
-static void __exit max77693_pmic_cleanup(void)
-{
-	platform_driver_unregister(&max77693_pmic_driver);
-}
-module_exit(max77693_pmic_cleanup);
+subsys_platform_driver(max77693_pmic_driver);
 
 MODULE_DESCRIPTION("MAXIM 77693/77843 regulator driver");
 MODULE_AUTHOR("Jonghwa Lee <jonghwa3.lee@samsung.com>");
diff --git a/drivers/regulator/max8907-regulator.c b/drivers/regulator/max8907-regulator.c
index e59aa7a3ee54..f8f0a50161c6 100644
--- a/drivers/regulator/max8907-regulator.c
+++ b/drivers/regulator/max8907-regulator.c
@@ -377,19 +377,7 @@ static struct platform_driver max8907_regulator_driver = {
 	.probe = max8907_regulator_probe,
 };
 
-static int __init max8907_regulator_init(void)
-{
-	return platform_driver_register(&max8907_regulator_driver);
-}
-
-subsys_initcall(max8907_regulator_init);
-
-static void __exit max8907_reg_exit(void)
-{
-	platform_driver_unregister(&max8907_regulator_driver);
-}
-
-module_exit(max8907_reg_exit);
+subsys_platform_driver(max8907_regulator_driver);
 
 MODULE_DESCRIPTION("MAX8907 regulator driver");
 MODULE_AUTHOR("Gyungoh Yoo <jack.yoo@maxim-ic.com>");
diff --git a/drivers/regulator/max8925-regulator.c b/drivers/regulator/max8925-regulator.c
index c1532db0a4ee..bdcbc457766c 100644
--- a/drivers/regulator/max8925-regulator.c
+++ b/drivers/regulator/max8925-regulator.c
@@ -267,18 +267,7 @@ static struct platform_driver max8925_regulator_driver = {
 	},
 	.probe		= max8925_regulator_probe,
 };
-
-static int __init max8925_regulator_init(void)
-{
-	return platform_driver_register(&max8925_regulator_driver);
-}
-subsys_initcall(max8925_regulator_init);
-
-static void __exit max8925_regulator_exit(void)
-{
-	platform_driver_unregister(&max8925_regulator_driver);
-}
-module_exit(max8925_regulator_exit);
+subsys_platform_driver(max8925_regulator_driver);
 
 MODULE_LICENSE("GPL");
 MODULE_AUTHOR("Haojian Zhuang <haojian.zhuang@marvell.com>");
diff --git a/drivers/regulator/max8997-regulator.c b/drivers/regulator/max8997-regulator.c
index e48ba694a906..25aac72b79e7 100644
--- a/drivers/regulator/max8997-regulator.c
+++ b/drivers/regulator/max8997-regulator.c
@@ -1165,18 +1165,7 @@ static struct platform_driver max8997_pmic_driver = {
 	.probe = max8997_pmic_probe,
 	.id_table = max8997_pmic_id,
 };
-
-static int __init max8997_pmic_init(void)
-{
-	return platform_driver_register(&max8997_pmic_driver);
-}
-subsys_initcall(max8997_pmic_init);
-
-static void __exit max8997_pmic_cleanup(void)
-{
-	platform_driver_unregister(&max8997_pmic_driver);
-}
-module_exit(max8997_pmic_cleanup);
+subsys_platform_driver(max8997_pmic_driver);
 
 MODULE_DESCRIPTION("MAXIM 8997/8966 Regulator Driver");
 MODULE_AUTHOR("MyungJoo Ham <myungjoo.ham@samsung.com>");
diff --git a/drivers/regulator/max8998.c b/drivers/regulator/max8998.c
index 90651f4d1828..2eb16fa92b86 100644
--- a/drivers/regulator/max8998.c
+++ b/drivers/regulator/max8998.c
@@ -765,18 +765,7 @@ static struct platform_driver max8998_pmic_driver = {
 	.probe = max8998_pmic_probe,
 	.id_table = max8998_pmic_id,
 };
-
-static int __init max8998_pmic_init(void)
-{
-	return platform_driver_register(&max8998_pmic_driver);
-}
-subsys_initcall(max8998_pmic_init);
-
-static void __exit max8998_pmic_cleanup(void)
-{
-	platform_driver_unregister(&max8998_pmic_driver);
-}
-module_exit(max8998_pmic_cleanup);
+subsys_platform_driver(max8998_pmic_driver);
 
 MODULE_DESCRIPTION("MAXIM 8998 voltage regulator driver");
 MODULE_AUTHOR("Kyungmin Park <kyungmin.park@samsung.com>");
diff --git a/drivers/regulator/mc13783-regulator.c b/drivers/regulator/mc13783-regulator.c
index fb3aa1cec1f2..449f4e3621c1 100644
--- a/drivers/regulator/mc13783-regulator.c
+++ b/drivers/regulator/mc13783-regulator.c
@@ -459,18 +459,7 @@ static struct platform_driver mc13783_regulator_driver = {
 	},
 	.probe		= mc13783_regulator_probe,
 };
-
-static int __init mc13783_regulator_init(void)
-{
-	return platform_driver_register(&mc13783_regulator_driver);
-}
-subsys_initcall(mc13783_regulator_init);
-
-static void __exit mc13783_regulator_exit(void)
-{
-	platform_driver_unregister(&mc13783_regulator_driver);
-}
-module_exit(mc13783_regulator_exit);
+subsys_platform_driver(mc13783_regulator_driver);
 
 MODULE_LICENSE("GPL v2");
 MODULE_AUTHOR("Sascha Hauer <s.hauer@pengutronix.de>");
diff --git a/drivers/regulator/mc13892-regulator.c b/drivers/regulator/mc13892-regulator.c
index b29cf6ba6f12..debec21aaf3c 100644
--- a/drivers/regulator/mc13892-regulator.c
+++ b/drivers/regulator/mc13892-regulator.c
@@ -633,18 +633,7 @@ static struct platform_driver mc13892_regulator_driver = {
 	},
 	.probe	= mc13892_regulator_probe,
 };
-
-static int __init mc13892_regulator_init(void)
-{
-	return platform_driver_register(&mc13892_regulator_driver);
-}
-subsys_initcall(mc13892_regulator_init);
-
-static void __exit mc13892_regulator_exit(void)
-{
-	platform_driver_unregister(&mc13892_regulator_driver);
-}
-module_exit(mc13892_regulator_exit);
+subsys_platform_driver(mc13892_regulator_driver);
 
 MODULE_LICENSE("GPL v2");
 MODULE_AUTHOR("Yong Shen <yong.shen@linaro.org>");
diff --git a/drivers/regulator/palmas-regulator.c b/drivers/regulator/palmas-regulator.c
index f82618a70106..bf66cfd11465 100644
--- a/drivers/regulator/palmas-regulator.c
+++ b/drivers/regulator/palmas-regulator.c
@@ -1668,18 +1668,7 @@ static struct platform_driver palmas_driver = {
 	},
 	.probe = palmas_regulators_probe,
 };
-
-static int __init palmas_init(void)
-{
-	return platform_driver_register(&palmas_driver);
-}
-subsys_initcall(palmas_init);
-
-static void __exit palmas_exit(void)
-{
-	platform_driver_unregister(&palmas_driver);
-}
-module_exit(palmas_exit);
+subsys_platform_driver(palmas_driver);
 
 MODULE_AUTHOR("Graeme Gregory <gg@slimlogic.co.uk>");
 MODULE_DESCRIPTION("Palmas voltage regulator driver");
diff --git a/drivers/regulator/rc5t583-regulator.c b/drivers/regulator/rc5t583-regulator.c
index a25a141e86c4..fff2b5be5cc1 100644
--- a/drivers/regulator/rc5t583-regulator.c
+++ b/drivers/regulator/rc5t583-regulator.c
@@ -152,18 +152,7 @@ static struct platform_driver rc5t583_regulator_driver = {
 	},
 	.probe		= rc5t583_regulator_probe,
 };
-
-static int __init rc5t583_regulator_init(void)
-{
-	return platform_driver_register(&rc5t583_regulator_driver);
-}
-subsys_initcall(rc5t583_regulator_init);
-
-static void __exit rc5t583_regulator_exit(void)
-{
-	platform_driver_unregister(&rc5t583_regulator_driver);
-}
-module_exit(rc5t583_regulator_exit);
+subsys_platform_driver(rc5t583_regulator_driver);
 
 MODULE_AUTHOR("Laxman Dewangan <ldewangan@nvidia.com>");
 MODULE_DESCRIPTION("RC5T583 regulator driver");
diff --git a/drivers/regulator/tps6105x-regulator.c b/drivers/regulator/tps6105x-regulator.c
index 7f99f3e90bec..d5a6d3554631 100644
--- a/drivers/regulator/tps6105x-regulator.c
+++ b/drivers/regulator/tps6105x-regulator.c
@@ -97,18 +97,7 @@ static struct platform_driver tps6105x_regulator_driver = {
 	},
 	.probe = tps6105x_regulator_probe,
 };
-
-static __init int tps6105x_regulator_init(void)
-{
-	return platform_driver_register(&tps6105x_regulator_driver);
-}
-subsys_initcall(tps6105x_regulator_init);
-
-static __exit void tps6105x_regulator_exit(void)
-{
-	platform_driver_unregister(&tps6105x_regulator_driver);
-}
-module_exit(tps6105x_regulator_exit);
+subsys_platform_driver(tps6105x_regulator_driver);
 
 MODULE_AUTHOR("Linus Walleij <linus.walleij@linaro.org>");
 MODULE_DESCRIPTION("TPS6105x regulator driver");
diff --git a/drivers/regulator/tps6507x-regulator.c b/drivers/regulator/tps6507x-regulator.c
index 6655d9c31187..bcfa418a503d 100644
--- a/drivers/regulator/tps6507x-regulator.c
+++ b/drivers/regulator/tps6507x-regulator.c
@@ -442,18 +442,7 @@ static struct platform_driver tps6507x_pmic_driver = {
 	},
 	.probe = tps6507x_pmic_probe,
 };
-
-static int __init tps6507x_pmic_init(void)
-{
-	return platform_driver_register(&tps6507x_pmic_driver);
-}
-subsys_initcall(tps6507x_pmic_init);
-
-static void __exit tps6507x_pmic_cleanup(void)
-{
-	platform_driver_unregister(&tps6507x_pmic_driver);
-}
-module_exit(tps6507x_pmic_cleanup);
+subsys_platform_driver(tps6507x_pmic_driver);
 
 MODULE_AUTHOR("Texas Instruments");
 MODULE_DESCRIPTION("TPS6507x voltage regulator driver");
diff --git a/drivers/regulator/tps65090-regulator.c b/drivers/regulator/tps65090-regulator.c
index 8f916ee366e5..8a5e0889551c 100644
--- a/drivers/regulator/tps65090-regulator.c
+++ b/drivers/regulator/tps65090-regulator.c
@@ -515,18 +515,7 @@ static struct platform_driver tps65090_regulator_driver = {
 	},
 	.probe		= tps65090_regulator_probe,
 };
-
-static int __init tps65090_regulator_init(void)
-{
-	return platform_driver_register(&tps65090_regulator_driver);
-}
-subsys_initcall(tps65090_regulator_init);
-
-static void __exit tps65090_regulator_exit(void)
-{
-	platform_driver_unregister(&tps65090_regulator_driver);
-}
-module_exit(tps65090_regulator_exit);
+subsys_platform_driver(tps65090_regulator_driver);
 
 MODULE_DESCRIPTION("tps65090 regulator driver");
 MODULE_AUTHOR("Venu Byravarasu <vbyravarasu@nvidia.com>");
diff --git a/drivers/regulator/tps65217-regulator.c b/drivers/regulator/tps65217-regulator.c
index b167ba22fe16..f55cc1a8079d 100644
--- a/drivers/regulator/tps65217-regulator.c
+++ b/drivers/regulator/tps65217-regulator.c
@@ -262,18 +262,7 @@ static struct platform_driver tps65217_regulator_driver = {
 	},
 	.probe = tps65217_regulator_probe,
 };
-
-static int __init tps65217_regulator_init(void)
-{
-	return platform_driver_register(&tps65217_regulator_driver);
-}
-subsys_initcall(tps65217_regulator_init);
-
-static void __exit tps65217_regulator_exit(void)
-{
-	platform_driver_unregister(&tps65217_regulator_driver);
-}
-module_exit(tps65217_regulator_exit);
+subsys_platform_driver(tps65217_regulator_driver);
 
 MODULE_AUTHOR("AnilKumar Ch <anilkumar@ti.com>");
 MODULE_DESCRIPTION("TPS65217 voltage regulator driver");
diff --git a/drivers/regulator/tps6586x-regulator.c b/drivers/regulator/tps6586x-regulator.c
index 1ab5767590f3..a144b4c5ed20 100644
--- a/drivers/regulator/tps6586x-regulator.c
+++ b/drivers/regulator/tps6586x-regulator.c
@@ -524,18 +524,7 @@ static struct platform_driver tps6586x_regulator_driver = {
 	},
 	.probe		= tps6586x_regulator_probe,
 };
-
-static int __init tps6586x_regulator_init(void)
-{
-	return platform_driver_register(&tps6586x_regulator_driver);
-}
-subsys_initcall(tps6586x_regulator_init);
-
-static void __exit tps6586x_regulator_exit(void)
-{
-	platform_driver_unregister(&tps6586x_regulator_driver);
-}
-module_exit(tps6586x_regulator_exit);
+subsys_platform_driver(tps6586x_regulator_driver);
 
 MODULE_LICENSE("GPL");
 MODULE_AUTHOR("Mike Rapoport <mike@compulab.co.il>");
diff --git a/drivers/regulator/tps65910-regulator.c b/drivers/regulator/tps65910-regulator.c
index 3a3027e0b94e..61bb269fc7c6 100644
--- a/drivers/regulator/tps65910-regulator.c
+++ b/drivers/regulator/tps65910-regulator.c
@@ -1259,18 +1259,7 @@ static struct platform_driver tps65910_driver = {
 	.probe = tps65910_probe,
 	.shutdown = tps65910_shutdown,
 };
-
-static int __init tps65910_init(void)
-{
-	return platform_driver_register(&tps65910_driver);
-}
-subsys_initcall(tps65910_init);
-
-static void __exit tps65910_cleanup(void)
-{
-	platform_driver_unregister(&tps65910_driver);
-}
-module_exit(tps65910_cleanup);
+subsys_platform_driver(tps65910_driver);
 
 MODULE_AUTHOR("Graeme Gregory <gg@slimlogic.co.uk>");
 MODULE_DESCRIPTION("TPS65910/TPS65911 voltage regulator driver");
diff --git a/drivers/regulator/tps68470-regulator.c b/drivers/regulator/tps68470-regulator.c
index de7db7690f6b..7aef0c12fbcc 100644
--- a/drivers/regulator/tps68470-regulator.c
+++ b/drivers/regulator/tps68470-regulator.c
@@ -185,17 +185,7 @@ static struct platform_driver tps68470_regulator_driver = {
  * registering before the drivers for the camera-sensors which use them bind.
  * subsys_initcall() ensures this when the drivers are builtin.
  */
-static int __init tps68470_regulator_init(void)
-{
-	return platform_driver_register(&tps68470_regulator_driver);
-}
-subsys_initcall(tps68470_regulator_init);
-
-static void __exit tps68470_regulator_exit(void)
-{
-	platform_driver_unregister(&tps68470_regulator_driver);
-}
-module_exit(tps68470_regulator_exit);
+subsys_platform_driver(tps68470_regulator_driver);
 
 MODULE_ALIAS("platform:tps68470-regulator");
 MODULE_DESCRIPTION("TPS68470 voltage regulator driver");
diff --git a/drivers/regulator/wm8350-regulator.c b/drivers/regulator/wm8350-regulator.c
index d09864bae5ef..8dfc24a74765 100644
--- a/drivers/regulator/wm8350-regulator.c
+++ b/drivers/regulator/wm8350-regulator.c
@@ -1310,18 +1310,7 @@ static struct platform_driver wm8350_regulator_driver = {
 		.probe_type = PROBE_PREFER_ASYNCHRONOUS,
 	},
 };
-
-static int __init wm8350_regulator_init(void)
-{
-	return platform_driver_register(&wm8350_regulator_driver);
-}
-subsys_initcall(wm8350_regulator_init);
-
-static void __exit wm8350_regulator_exit(void)
-{
-	platform_driver_unregister(&wm8350_regulator_driver);
-}
-module_exit(wm8350_regulator_exit);
+subsys_platform_driver(wm8350_regulator_driver);
 
 /* Module information */
 MODULE_AUTHOR("Liam Girdwood");
diff --git a/drivers/regulator/wm8400-regulator.c b/drivers/regulator/wm8400-regulator.c
index fb3ca7956d00..f9b9973b70e5 100644
--- a/drivers/regulator/wm8400-regulator.c
+++ b/drivers/regulator/wm8400-regulator.c
@@ -257,18 +257,7 @@ int wm8400_register_regulator(struct device *dev, int reg,
 	return platform_device_register(&wm8400->regulators[reg]);
 }
 EXPORT_SYMBOL_GPL(wm8400_register_regulator);
-
-static int __init wm8400_regulator_init(void)
-{
-	return platform_driver_register(&wm8400_regulator_driver);
-}
-subsys_initcall(wm8400_regulator_init);
-
-static void __exit wm8400_regulator_exit(void)
-{
-	platform_driver_unregister(&wm8400_regulator_driver);
-}
-module_exit(wm8400_regulator_exit);
+subsys_platform_driver(wm8400_regulator_driver);
 
 MODULE_AUTHOR("Mark Brown <broonie@opensource.wolfsonmicro.com>");
 MODULE_DESCRIPTION("WM8400 regulator driver");
-- 
2.51.0


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] regulator: Convert to subsys_platform_driver()
  2026-11-04 11:33 [PATCH] regulator: Convert to subsys_platform_driver() Peng Fan (OSS)
@ 2026-11-04 11:49 ` Charles Keepax
  0 siblings, 0 replies; 2+ messages in thread
From: Charles Keepax @ 2026-11-04 11:49 UTC (permalink / raw)
  To: Peng Fan (OSS)
  Cc: Liam Girdwood, Mark Brown, Support Opensource, Chanwoo Choi,
	Krzysztof Kozlowski, Aaro Koskinen, Andreas Kemnade,
	Kevin Hilman, Roger Quadros, Tony Lindgren, linux-kernel,
	linux-omap, patches

On Wed, Nov 04, 2026 at 07:33:52PM +0800, Peng Fan (OSS) wrote:
> From: Peng Fan <peng.fan@nxp.com>
> 
> 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@nxp.com>
> ---
>  drivers/regulator/wm8350-regulator.c   | 13 +------------
>  drivers/regulator/wm8400-regulator.c   | 13 +------------

Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>

Thanks,
Charles

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-11-04 11:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-04 11:33 [PATCH] regulator: Convert to subsys_platform_driver() Peng Fan (OSS)
2026-11-04 11:49 ` Charles Keepax

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®