linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] spi: davinci: Use of_device_get_match_data() helper
@ 2021-03-29  8:58 Tian Tao
  2021-03-29 15:21 ` Mark Brown
  0 siblings, 1 reply; 9+ messages in thread
From: Tian Tao @ 2021-03-29  8:58 UTC (permalink / raw)
  To: broonie; +Cc: linux-spi

Use the of_device_get_match_data() helper instead of open coding.

Signed-off-by: Tian Tao <tiantao6@hisilicon.com>
---
 drivers/spi/spi-davinci.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/spi/spi-davinci.c b/drivers/spi/spi-davinci.c
index 7453a1d..869045f 100644
--- a/drivers/spi/spi-davinci.c
+++ b/drivers/spi/spi-davinci.c
@@ -820,16 +820,14 @@ static int spi_davinci_get_pdata(struct platform_device *pdev,
 	struct davinci_spi_of_data *spi_data;
 	struct davinci_spi_platform_data *pdata;
 	unsigned int num_cs, intr_line = 0;
-	const struct of_device_id *match;
 
 	pdata = &dspi->pdata;
 
-	match = of_match_device(davinci_spi_of_match, &pdev->dev);
-	if (!match)
+	spi_data = (struct davinci_spi_of_data *)
+			of_device_get_match_data(&pdev->dev);
+	if (!spi_data)
 		return -ENODEV;
 
-	spi_data = (struct davinci_spi_of_data *)match->data;
-
 	pdata->version = spi_data->version;
 	pdata->prescaler_limit = spi_data->prescaler_limit;
 	/*
-- 
2.7.4


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

end of thread, other threads:[~2021-03-30 12:18 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-29  8:58 [PATCH] spi: davinci: Use of_device_get_match_data() helper Tian Tao
2021-03-29 15:21 ` Mark Brown
2021-03-30  0:53   ` tiantao (H)
2021-03-30 10:47     ` Mark Brown
2021-03-30 11:56     ` Fabio Estevam
2021-03-30 12:11       ` tiantao (H)
2021-03-30 12:15         ` Fabio Estevam
2021-03-30 12:17           ` tiantao (H)
2021-03-30 12:12       ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).