Commit 30700a05 authored by Tian Tao's avatar Tian Tao Committed by Mark Brown

spi: davinci: Use device_get_match_data() helper

Use the device_get_match_data() helper instead of open coding.
Signed-off-by: default avatarTian Tao <tiantao6@hisilicon.com>
Suggested-by: default avatarFabio Estevam <festevam@gmail.com>
Link: https://lore.kernel.org/r/1617152319-17701-1-git-send-email-tiantao6@hisilicon.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent cec77e0a
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment