aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTian Tao2021-03-31 08:58:39 +0800
committerMark Brown2021-04-09 13:44:04 +0100
commit30700a057ce84e6f18f4cc3627570f8b2ae3c17f (patch)
tree17f8a5f3be14292e9c306da561095215afd7910a
parentcec77e0a249892ceb10061bf17b63f9fb111d870 (diff)
spi: davinci: Use device_get_match_data() helper
Use the device_get_match_data() helper instead of open coding. Signed-off-by: Tian Tao <tiantao6@hisilicon.com> Suggested-by: Fabio Estevam <festevam@gmail.com> Link: https://lore.kernel.org/r/1617152319-17701-1-git-send-email-tiantao6@hisilicon.com Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r--drivers/spi/spi-davinci.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/drivers/spi/spi-davinci.c b/drivers/spi/spi-davinci.c
index 7453a1dbbc06..e114e6fe5ea5 100644
--- a/drivers/spi/spi-davinci.c
+++ b/drivers/spi/spi-davinci.c
@@ -817,18 +817,13 @@ static int spi_davinci_get_pdata(struct platform_device *pdev,
struct davinci_spi *dspi)
{
struct device_node *node = pdev->dev.of_node;
- struct davinci_spi_of_data *spi_data;
+ const 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)
- return -ENODEV;
-
- spi_data = (struct davinci_spi_of_data *)match->data;
+ spi_data = device_get_match_data(&pdev->dev);
pdata->version = spi_data->version;
pdata->prescaler_limit = spi_data->prescaler_limit;