mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] spi: omap2-mcspi: Use of_device_get_match_data()
@ 2026-05-19  0:43 Rosen Penev
  2026-05-25 12:34 ` Mark Brown
  0 siblings, 1 reply; 2+ messages in thread
From: Rosen Penev @ 2026-05-19  0:43 UTC (permalink / raw)
  To: linux-spi; +Cc: Mark Brown, open list

Use of_device_get_match_data() to fetch platform match data directly
instead of open-coding an of_match_device() lookup.

This also lets the driver drop the of_device.h include.

Assisted-by: Codex:GPT-5.5
Signed-off-by: Rosen Penev <rosenp@gmail.com>
---
 drivers/spi/spi-omap2-mcspi.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/spi/spi-omap2-mcspi.c b/drivers/spi/spi-omap2-mcspi.c
index d53f98aa0aac..9cc078acc13c 100644
--- a/drivers/spi/spi-omap2-mcspi.c
+++ b/drivers/spi/spi-omap2-mcspi.c
@@ -22,7 +22,6 @@
 #include <linux/slab.h>
 #include <linux/pm_runtime.h>
 #include <linux/of.h>
-#include <linux/of_device.h>
 #include <linux/gcd.h>

 #include <linux/spi/spi.h>
@@ -1481,7 +1480,6 @@ static int omap2_mcspi_probe(struct platform_device *pdev)
 	int			status = 0, i;
 	u32			regs_offset = 0;
 	struct device_node	*node = pdev->dev.of_node;
-	const struct of_device_id *match;

 	if (of_property_read_bool(node, "spi-slave"))
 		ctlr = devm_spi_alloc_target(&pdev->dev, sizeof(*mcspi));
@@ -1509,10 +1507,9 @@ static int omap2_mcspi_probe(struct platform_device *pdev)
 	mcspi = spi_controller_get_devdata(ctlr);
 	mcspi->ctlr = ctlr;

-	match = of_match_device(omap_mcspi_of_match, &pdev->dev);
-	if (match) {
+	pdata = of_device_get_match_data(&pdev->dev);
+	if (pdata) {
 		u32 num_cs = 1; /* default number of chipselect */
-		pdata = match->data;

 		of_property_read_u32(node, "ti,spi-num-cs", &num_cs);
 		ctlr->num_chipselect = num_cs;
--
2.54.0


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

* Re: [PATCH] spi: omap2-mcspi: Use of_device_get_match_data()
  2026-05-19  0:43 [PATCH] spi: omap2-mcspi: Use of_device_get_match_data() Rosen Penev
@ 2026-05-25 12:34 ` Mark Brown
  0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2026-05-25 12:34 UTC (permalink / raw)
  To: linux-spi, Rosen Penev; +Cc: linux-kernel

On Mon, 18 May 2026 17:43:52 -0700, Rosen Penev wrote:
> spi: omap2-mcspi: Use of_device_get_match_data()

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-7.2

Thanks!

[1/1] spi: omap2-mcspi: Use of_device_get_match_data()
      https://git.kernel.org/broonie/spi/c/82056957e5c4

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark


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

end of thread, other threads:[~2026-05-25 15:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-05-19  0:43 [PATCH] spi: omap2-mcspi: Use of_device_get_match_data() Rosen Penev
2026-05-25 12:34 ` Mark Brown

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®