* [PATCH] spi: Convert to subsys_platform_driver()
@ 2026-11-04 11:34 Peng Fan (OSS)
2026-11-04 12:04 ` Andy Shevchenko
0 siblings, 1 reply; 2+ messages in thread
From: Peng Fan (OSS) @ 2026-11-04 11:34 UTC (permalink / raw)
To: Mark Brown, Andy Shevchenko, Daniel Mack, Haojian Zhuang, Robert Jarzmik
Cc: linux-spi, linux-kernel, linux-arm-kernel
From: Peng Fan <peng.fan@nxp.com>
Replace the open-coded subsys_initcall()/module_exit() platform driver
registration with subsys_platform_driver().
The pxa2xx platform driver is renamed from "driver" to
"pxa2xx_spi_driver" because subsys_platform_driver() generates
"<name>_init", which would otherwise conflict with the core
driver_init() declaration.
No functional change.
Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
drivers/spi/spi-omap-uwire.c | 13 +------------
drivers/spi/spi-pxa2xx-platform.c | 15 ++-------------
2 files changed, 3 insertions(+), 25 deletions(-)
diff --git a/drivers/spi/spi-omap-uwire.c b/drivers/spi/spi-omap-uwire.c
index 83e263eb6069..6838a0603c90 100644
--- a/drivers/spi/spi-omap-uwire.c
+++ b/drivers/spi/spi-omap-uwire.c
@@ -528,18 +528,7 @@ static struct platform_driver uwire_driver = {
// resume ... use ck
};
-static int __init omap_uwire_init(void)
-{
- return platform_driver_register(&uwire_driver);
-}
-
-static void __exit omap_uwire_exit(void)
-{
- platform_driver_unregister(&uwire_driver);
-}
-
-subsys_initcall(omap_uwire_init);
-module_exit(omap_uwire_exit);
+subsys_platform_driver(uwire_driver);
MODULE_DESCRIPTION("MicroWire interface driver for OMAP");
MODULE_LICENSE("GPL");
diff --git a/drivers/spi/spi-pxa2xx-platform.c b/drivers/spi/spi-pxa2xx-platform.c
index 849a14cd0343..eee70e1f8690 100644
--- a/drivers/spi/spi-pxa2xx-platform.c
+++ b/drivers/spi/spi-pxa2xx-platform.c
@@ -198,7 +198,7 @@ static const struct of_device_id pxa2xx_spi_of_match[] = {
};
MODULE_DEVICE_TABLE(of, pxa2xx_spi_of_match);
-static struct platform_driver driver = {
+static struct platform_driver pxa2xx_spi_driver = {
.driver = {
.name = "pxa2xx-spi",
.pm = pm_ptr(&pxa2xx_spi_pm_ops),
@@ -208,18 +208,7 @@ static struct platform_driver driver = {
.probe = pxa2xx_spi_platform_probe,
.remove = pxa2xx_spi_platform_remove,
};
-
-static int __init pxa2xx_spi_init(void)
-{
- return platform_driver_register(&driver);
-}
-subsys_initcall(pxa2xx_spi_init);
-
-static void __exit pxa2xx_spi_exit(void)
-{
- platform_driver_unregister(&driver);
-}
-module_exit(pxa2xx_spi_exit);
+subsys_platform_driver(pxa2xx_spi_driver);
MODULE_AUTHOR("Stephen Street");
MODULE_DESCRIPTION("PXA2xx SSP SPI Controller platform driver");
--
2.51.0
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] spi: Convert to subsys_platform_driver()
2026-11-04 11:34 [PATCH] spi: Convert to subsys_platform_driver() Peng Fan (OSS)
@ 2026-11-04 12:04 ` Andy Shevchenko
0 siblings, 0 replies; 2+ messages in thread
From: Andy Shevchenko @ 2026-11-04 12:04 UTC (permalink / raw)
To: Peng Fan (OSS)
Cc: Mark Brown, Daniel Mack, Haojian Zhuang, Robert Jarzmik,
linux-spi, linux-kernel, linux-arm-kernel
On Wed, Nov 04, 2026 at 07:34:05PM +0800, Peng Fan (OSS) wrote:
> Replace the open-coded subsys_initcall()/module_exit() platform driver
> registration with subsys_platform_driver().
>
> The pxa2xx platform driver is renamed from "driver" to
> "pxa2xx_spi_driver" because subsys_platform_driver() generates
> "<name>_init", which would otherwise conflict with the core
> driver_init() declaration.
>
> No functional change.
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> # pxa2xx
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-11-04 12:04 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:34 [PATCH] spi: Convert to subsys_platform_driver() Peng Fan (OSS)
2026-11-04 12:04 ` Andy Shevchenko
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®