From: Felix Gu <ustc.gu@gmail.com>
To: Mark Brown <broonie@kernel.org>
Cc: linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org,
Felix Gu <ustc.gu@gmail.com>
Subject: [PATCH] spi: ar934x: Convert to devm_spi_register_controller()
Date: Mon, 07 Sep 2026 20:35:45 +0800 [thread overview]
Message-ID: <20260907-ar934x-v1-1-71327eb482bc@gmail.com> (raw)
Switch to devm_spi_register_controller() and drop the unneeded
.remove callback and dev_set_drvdata().
Signed-off-by: Felix Gu <ustc.gu@gmail.com>
---
drivers/spi/spi-ar934x.c | 13 +------------
1 file changed, 1 insertion(+), 12 deletions(-)
diff --git a/drivers/spi/spi-ar934x.c b/drivers/spi/spi-ar934x.c
index 2210186feab8..01e51a30591d 100644
--- a/drivers/spi/spi-ar934x.c
+++ b/drivers/spi/spi-ar934x.c
@@ -197,23 +197,13 @@ static int ar934x_spi_probe(struct platform_device *pdev)
SPI_BPW_MASK(16) | SPI_BPW_MASK(8);
ctlr->num_chipselect = 3;
- dev_set_drvdata(&pdev->dev, ctlr);
-
sp = spi_controller_get_devdata(ctlr);
sp->base = base;
sp->clk = clk;
sp->clk_freq = clk_get_rate(clk);
sp->ctlr = ctlr;
- return spi_register_controller(ctlr);
-}
-
-static void ar934x_spi_remove(struct platform_device *pdev)
-{
- struct spi_controller *ctlr;
-
- ctlr = dev_get_drvdata(&pdev->dev);
- spi_unregister_controller(ctlr);
+ return devm_spi_register_controller(&pdev->dev, ctlr);
}
static struct platform_driver ar934x_spi_driver = {
@@ -222,7 +212,6 @@ static struct platform_driver ar934x_spi_driver = {
.of_match_table = ar934x_spi_match,
},
.probe = ar934x_spi_probe,
- .remove = ar934x_spi_remove,
};
module_platform_driver(ar934x_spi_driver);
---
base-commit: 9d80aa4617b32f5054c5aa471d06b66704854935
change-id: 20260907-ar934x-1f451bec828d
Best regards,
--
Felix Gu <ustc.gu@gmail.com>
next reply other threads:[~2026-09-07 12:35 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-07 12:35 Felix Gu [this message]
2026-09-08 15:16 ` Mark Brown
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=20260907-ar934x-v1-1-71327eb482bc@gmail.com \
--to=ustc.gu@gmail.com \
--cc=broonie@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-spi@vger.kernel.org \
/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®