* [PATCH] gpio: Convert to subsys_platform_driver()
@ 2026-11-04 11:33 Peng Fan (OSS)
2026-11-04 11:48 ` Charles Keepax
0 siblings, 1 reply; 2+ messages in thread
From: Peng Fan (OSS) @ 2026-11-04 11:33 UTC (permalink / raw)
To: Adrian Ng, Linus Walleij, Bartosz Golaszewski, Support Opensource,
Maxime Coquelin, Alexandre Torgue, Shubhrajyoti Datta,
Srinivas Neeli, Michal Simek
Cc: linux-gpio, linux-kernel, linux-stm32, linux-arm-kernel, 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/gpio/gpio-altera.c | 13 +------------
drivers/gpio/gpio-da9055.c | 13 +------------
drivers/gpio/gpio-mm-lantiq.c | 13 +------------
drivers/gpio/gpio-palmas.c | 13 +------------
drivers/gpio/gpio-stmpe.c | 13 +------------
drivers/gpio/gpio-twl4030.c | 13 +------------
drivers/gpio/gpio-wm831x.c | 13 +------------
drivers/gpio/gpio-wm8350.c | 13 +------------
drivers/gpio/gpio-wm8994.c | 13 +------------
drivers/gpio/gpio-xilinx.c | 13 +------------
10 files changed, 10 insertions(+), 120 deletions(-)
diff --git a/drivers/gpio/gpio-altera.c b/drivers/gpio/gpio-altera.c
index a6ac9356229c..6c30608bff89 100644
--- a/drivers/gpio/gpio-altera.c
+++ b/drivers/gpio/gpio-altera.c
@@ -272,18 +272,7 @@ static struct platform_driver altera_gpio_driver = {
},
.probe = altera_gpio_probe,
};
-
-static int __init altera_gpio_init(void)
-{
- return platform_driver_register(&altera_gpio_driver);
-}
-subsys_initcall(altera_gpio_init);
-
-static void __exit altera_gpio_exit(void)
-{
- platform_driver_unregister(&altera_gpio_driver);
-}
-module_exit(altera_gpio_exit);
+subsys_platform_driver(altera_gpio_driver);
MODULE_AUTHOR("Tien Hock Loh <thloh@altera.com>");
MODULE_DESCRIPTION("Altera GPIO driver");
diff --git a/drivers/gpio/gpio-da9055.c b/drivers/gpio/gpio-da9055.c
index 1949a6ea8ec6..f9ff2f83ffed 100644
--- a/drivers/gpio/gpio-da9055.c
+++ b/drivers/gpio/gpio-da9055.c
@@ -150,18 +150,7 @@ static struct platform_driver da9055_gpio_driver = {
.name = "da9055-gpio",
},
};
-
-static int __init da9055_gpio_init(void)
-{
- return platform_driver_register(&da9055_gpio_driver);
-}
-subsys_initcall(da9055_gpio_init);
-
-static void __exit da9055_gpio_exit(void)
-{
- platform_driver_unregister(&da9055_gpio_driver);
-}
-module_exit(da9055_gpio_exit);
+subsys_platform_driver(da9055_gpio_driver);
MODULE_AUTHOR("David Dajun Chen <dchen@diasemi.com>");
MODULE_DESCRIPTION("DA9055 GPIO Device Driver");
diff --git a/drivers/gpio/gpio-mm-lantiq.c b/drivers/gpio/gpio-mm-lantiq.c
index 1bd98c50a459..2ddf63357127 100644
--- a/drivers/gpio/gpio-mm-lantiq.c
+++ b/drivers/gpio/gpio-mm-lantiq.c
@@ -146,15 +146,4 @@ static struct platform_driver ltq_mm_driver = {
},
};
-static int __init ltq_mm_init(void)
-{
- return platform_driver_register(<q_mm_driver);
-}
-
-subsys_initcall(ltq_mm_init);
-
-static void __exit ltq_mm_exit(void)
-{
- platform_driver_unregister(<q_mm_driver);
-}
-module_exit(ltq_mm_exit);
+subsys_platform_driver(ltq_mm_driver);
diff --git a/drivers/gpio/gpio-palmas.c b/drivers/gpio/gpio-palmas.c
index e64ee0487718..da699c419823 100644
--- a/drivers/gpio/gpio-palmas.c
+++ b/drivers/gpio/gpio-palmas.c
@@ -210,18 +210,7 @@ static struct platform_driver palmas_gpio_driver = {
.driver.of_match_table = of_palmas_gpio_match,
.probe = palmas_gpio_probe,
};
-
-static int __init palmas_gpio_init(void)
-{
- return platform_driver_register(&palmas_gpio_driver);
-}
-subsys_initcall(palmas_gpio_init);
-
-static void __exit palmas_gpio_exit(void)
-{
- platform_driver_unregister(&palmas_gpio_driver);
-}
-module_exit(palmas_gpio_exit);
+subsys_platform_driver(palmas_gpio_driver);
MODULE_DESCRIPTION("TI PALMAS series GPIO driver");
MODULE_AUTHOR("Laxman Dewangan <ldewangan@nvidia.com>");
diff --git a/drivers/gpio/gpio-stmpe.c b/drivers/gpio/gpio-stmpe.c
index ccdf13a741b7..12b1778c4be9 100644
--- a/drivers/gpio/gpio-stmpe.c
+++ b/drivers/gpio/gpio-stmpe.c
@@ -545,18 +545,7 @@ static struct platform_driver stmpe_gpio_driver = {
},
.probe = stmpe_gpio_probe,
};
-
-static int __init stmpe_gpio_init(void)
-{
- return platform_driver_register(&stmpe_gpio_driver);
-}
-subsys_initcall(stmpe_gpio_init);
-
-static void __exit stmpe_gpio_exit(void)
-{
- platform_driver_unregister(&stmpe_gpio_driver);
-}
-module_exit(stmpe_gpio_exit);
+subsys_platform_driver(stmpe_gpio_driver);
MODULE_DESCRIPTION("STMPE expander GPIO");
MODULE_AUTHOR("Rabin Vincent <rabin.vincent@stericsson.com>");
diff --git a/drivers/gpio/gpio-twl4030.c b/drivers/gpio/gpio-twl4030.c
index a851702befde..6ea0be23ae7e 100644
--- a/drivers/gpio/gpio-twl4030.c
+++ b/drivers/gpio/gpio-twl4030.c
@@ -619,18 +619,7 @@ static struct platform_driver gpio_twl4030_driver = {
},
.probe = gpio_twl4030_probe,
};
-
-static int __init gpio_twl4030_init(void)
-{
- return platform_driver_register(&gpio_twl4030_driver);
-}
-subsys_initcall(gpio_twl4030_init);
-
-static void __exit gpio_twl4030_exit(void)
-{
- platform_driver_unregister(&gpio_twl4030_driver);
-}
-module_exit(gpio_twl4030_exit);
+subsys_platform_driver(gpio_twl4030_driver);
MODULE_AUTHOR("Texas Instruments, Inc.");
MODULE_DESCRIPTION("GPIO interface for TWL4030");
diff --git a/drivers/gpio/gpio-wm831x.c b/drivers/gpio/gpio-wm831x.c
index 489479d6f32b..b16aabcef57b 100644
--- a/drivers/gpio/gpio-wm831x.c
+++ b/drivers/gpio/gpio-wm831x.c
@@ -288,18 +288,7 @@ static struct platform_driver wm831x_gpio_driver = {
.driver.name = "wm831x-gpio",
.probe = wm831x_gpio_probe,
};
-
-static int __init wm831x_gpio_init(void)
-{
- return platform_driver_register(&wm831x_gpio_driver);
-}
-subsys_initcall(wm831x_gpio_init);
-
-static void __exit wm831x_gpio_exit(void)
-{
- platform_driver_unregister(&wm831x_gpio_driver);
-}
-module_exit(wm831x_gpio_exit);
+subsys_platform_driver(wm831x_gpio_driver);
MODULE_AUTHOR("Mark Brown <broonie@opensource.wolfsonmicro.com>");
MODULE_DESCRIPTION("GPIO interface for WM831x PMICs");
diff --git a/drivers/gpio/gpio-wm8350.c b/drivers/gpio/gpio-wm8350.c
index 46923b23a72e..30936ec32b05 100644
--- a/drivers/gpio/gpio-wm8350.c
+++ b/drivers/gpio/gpio-wm8350.c
@@ -125,18 +125,7 @@ static struct platform_driver wm8350_gpio_driver = {
.driver.name = "wm8350-gpio",
.probe = wm8350_gpio_probe,
};
-
-static int __init wm8350_gpio_init(void)
-{
- return platform_driver_register(&wm8350_gpio_driver);
-}
-subsys_initcall(wm8350_gpio_init);
-
-static void __exit wm8350_gpio_exit(void)
-{
- platform_driver_unregister(&wm8350_gpio_driver);
-}
-module_exit(wm8350_gpio_exit);
+subsys_platform_driver(wm8350_gpio_driver);
MODULE_AUTHOR("Mark Brown <broonie@opensource.wolfsonmicro.com>");
MODULE_DESCRIPTION("GPIO interface for WM8350 PMICs");
diff --git a/drivers/gpio/gpio-wm8994.c b/drivers/gpio/gpio-wm8994.c
index a0665cf3ff2f..d0c418bc6e03 100644
--- a/drivers/gpio/gpio-wm8994.c
+++ b/drivers/gpio/gpio-wm8994.c
@@ -288,18 +288,7 @@ static struct platform_driver wm8994_gpio_driver = {
.driver.name = "wm8994-gpio",
.probe = wm8994_gpio_probe,
};
-
-static int __init wm8994_gpio_init(void)
-{
- return platform_driver_register(&wm8994_gpio_driver);
-}
-subsys_initcall(wm8994_gpio_init);
-
-static void __exit wm8994_gpio_exit(void)
-{
- platform_driver_unregister(&wm8994_gpio_driver);
-}
-module_exit(wm8994_gpio_exit);
+subsys_platform_driver(wm8994_gpio_driver);
MODULE_AUTHOR("Mark Brown <broonie@opensource.wolfsonmicro.com>");
MODULE_DESCRIPTION("GPIO interface for WM8994");
diff --git a/drivers/gpio/gpio-xilinx.c b/drivers/gpio/gpio-xilinx.c
index 9406ce85f933..e7c483f93d9d 100644
--- a/drivers/gpio/gpio-xilinx.c
+++ b/drivers/gpio/gpio-xilinx.c
@@ -676,18 +676,7 @@ static struct platform_driver xgpio_plat_driver = {
},
};
-static int __init xgpio_init(void)
-{
- return platform_driver_register(&xgpio_plat_driver);
-}
-
-subsys_initcall(xgpio_init);
-
-static void __exit xgpio_exit(void)
-{
- platform_driver_unregister(&xgpio_plat_driver);
-}
-module_exit(xgpio_exit);
+subsys_platform_driver(xgpio_plat_driver);
MODULE_AUTHOR("Xilinx, Inc.");
MODULE_DESCRIPTION("Xilinx GPIO driver");
--
2.51.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] gpio: Convert to subsys_platform_driver()
2026-11-04 11:33 [PATCH] gpio: Convert to subsys_platform_driver() Peng Fan (OSS)
@ 2026-11-04 11:48 ` Charles Keepax
0 siblings, 0 replies; 2+ messages in thread
From: Charles Keepax @ 2026-11-04 11:48 UTC (permalink / raw)
To: Peng Fan (OSS)
Cc: Adrian Ng, Linus Walleij, Bartosz Golaszewski, Support Opensource,
Maxime Coquelin, Alexandre Torgue, Shubhrajyoti Datta,
Srinivas Neeli, Michal Simek, linux-gpio, linux-kernel,
linux-stm32, linux-arm-kernel, patches
On Wed, Nov 04, 2026 at 07:33:09PM +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/gpio/gpio-wm831x.c | 13 +------------
> drivers/gpio/gpio-wm8350.c | 13 +------------
> drivers/gpio/gpio-wm8994.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:49 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] gpio: Convert to subsys_platform_driver() Peng Fan (OSS)
2026-11-04 11:48 ` Charles Keepax
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox