mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/2] spi: convert to subsys_platform_driver()
@ 2026-11-07  0:33 Brian Masney
  2026-11-07  0:33 ` [PATCH 1/2] spi: omap-uwire: " Brian Masney
  2026-11-07  0:33 ` [PATCH 2/2] spi: pxa2xx: " Brian Masney
  0 siblings, 2 replies; 3+ messages in thread
From: Brian Masney @ 2026-11-07  0:33 UTC (permalink / raw)
  To: Mark Brown, Andy Shevchenko, Daniel Mack, Haojian Zhuang, Robert Jarzmik
  Cc: linux-spi, linux-kernel, linux-arm-kernel, Brian Masney

Reduce boilerplate code in these drivers and convert them over to use
the macro subsys_platform_driver().

Signed-off-by: Brian Masney <bmasney@redhat.com>
---
Brian Masney (2):
      spi: omap-uwire: convert to subsys_platform_driver()
      spi: pxa2xx: convert to subsys_platform_driver()

 drivers/spi/spi-omap-uwire.c      | 14 +-------------
 drivers/spi/spi-pxa2xx-platform.c | 14 ++------------
 2 files changed, 3 insertions(+), 25 deletions(-)
---
base-commit: ddfe51b0a0f5dc9e415cc2c8ad8db17532dd426b
base-tree: git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
change-id: 20261106-spi-subsys-32156ad80403

Best regards,
--  
Brian Masney <bmasney@redhat.com>


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

* [PATCH 1/2] spi: omap-uwire: convert to subsys_platform_driver()
  2026-11-07  0:33 [PATCH 0/2] spi: convert to subsys_platform_driver() Brian Masney
@ 2026-11-07  0:33 ` Brian Masney
  2026-11-07  0:33 ` [PATCH 2/2] spi: pxa2xx: " Brian Masney
  1 sibling, 0 replies; 3+ messages in thread
From: Brian Masney @ 2026-11-07  0:33 UTC (permalink / raw)
  To: Mark Brown, Andy Shevchenko, Daniel Mack, Haojian Zhuang, Robert Jarzmik
  Cc: linux-spi, linux-kernel, linux-arm-kernel, Brian Masney

Reduce boilerplate code in this driver and convert it over to use
the macro subsys_platform_driver().

Signed-off-by: Brian Masney <bmasney@redhat.com>
---
 drivers/spi/spi-omap-uwire.c | 14 +-------------
 1 file changed, 1 insertion(+), 13 deletions(-)

diff --git a/drivers/spi/spi-omap-uwire.c b/drivers/spi/spi-omap-uwire.c
index 83e263eb6069..91bd733ca15d 100644
--- a/drivers/spi/spi-omap-uwire.c
+++ b/drivers/spi/spi-omap-uwire.c
@@ -528,19 +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");
-

-- 
2.56.0


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

* [PATCH 2/2] spi: pxa2xx: convert to subsys_platform_driver()
  2026-11-07  0:33 [PATCH 0/2] spi: convert to subsys_platform_driver() Brian Masney
  2026-11-07  0:33 ` [PATCH 1/2] spi: omap-uwire: " Brian Masney
@ 2026-11-07  0:33 ` Brian Masney
  1 sibling, 0 replies; 3+ messages in thread
From: Brian Masney @ 2026-11-07  0:33 UTC (permalink / raw)
  To: Mark Brown, Andy Shevchenko, Daniel Mack, Haojian Zhuang, Robert Jarzmik
  Cc: linux-spi, linux-kernel, linux-arm-kernel, Brian Masney

Reduce boilerplate code in this driver and convert it over to use
the macro subsys_platform_driver().

Note that this needs to rename the driver variable to pxa2xx_spi_driver
to avoid a compilation error with the macro.

Signed-off-by: Brian Masney <bmasney@redhat.com>
---
 drivers/spi/spi-pxa2xx-platform.c | 14 ++------------
 1 file changed, 2 insertions(+), 12 deletions(-)

diff --git a/drivers/spi/spi-pxa2xx-platform.c b/drivers/spi/spi-pxa2xx-platform.c
index 849a14cd0343..2151ed168e57 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),
@@ -209,17 +209,7 @@ static struct platform_driver driver = {
 	.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.56.0


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

end of thread, other threads:[~2026-11-07  0:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-07  0:33 [PATCH 0/2] spi: convert to subsys_platform_driver() Brian Masney
2026-11-07  0:33 ` [PATCH 1/2] spi: omap-uwire: " Brian Masney
2026-11-07  0:33 ` [PATCH 2/2] spi: pxa2xx: " Brian Masney

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®