From: Brian Masney <bmasney@redhat.com>
To: Mark Brown <broonie@kernel.org>,
Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
Daniel Mack <daniel@zonque.org>,
Haojian Zhuang <haojian.zhuang@gmail.com>,
Robert Jarzmik <robert.jarzmik@free.fr>
Cc: linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
Brian Masney <bmasney@redhat.com>
Subject: [PATCH 2/2] spi: pxa2xx: convert to subsys_platform_driver()
Date: Fri, 06 Nov 2026 19:33:09 -0500 [thread overview]
Message-ID: <20261106-spi-subsys-v1-2-a51a08f21cf2@redhat.com> (raw)
In-Reply-To: <20261106-spi-subsys-v1-0-a51a08f21cf2@redhat.com>
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
prev parent reply other threads:[~2026-11-07 0:33 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-07 0:33 [PATCH 0/2] spi: " Brian Masney
2026-11-07 0:33 ` [PATCH 1/2] spi: omap-uwire: " Brian Masney
2026-11-07 0:33 ` Brian Masney [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261106-spi-subsys-v1-2-a51a08f21cf2@redhat.com \
--to=bmasney@redhat.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=broonie@kernel.org \
--cc=daniel@zonque.org \
--cc=haojian.zhuang@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-spi@vger.kernel.org \
--cc=robert.jarzmik@free.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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®