Skip to content

Commit

Permalink
spi: rspi: Use of_device_get_match_data() helper
Browse files Browse the repository at this point in the history
Use the of_device_get_match_data() helper instead of open coding.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Mark Brown <broonie@kernel.org>
  • Loading branch information
Geert Uytterhoeven authored and Mark Brown committed Oct 4, 2017
1 parent 10c1705 commit 219a7bc
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions drivers/spi/spi-rspi.c
Original file line number Diff line number Diff line change
Expand Up @@ -1221,17 +1221,15 @@ static int rspi_probe(struct platform_device *pdev)
struct spi_master *master;
struct rspi_data *rspi;
int ret;
const struct of_device_id *of_id;
const struct rspi_plat_data *rspi_pd;
const struct spi_ops *ops;

master = spi_alloc_master(&pdev->dev, sizeof(struct rspi_data));
if (master == NULL)
return -ENOMEM;

of_id = of_match_device(rspi_of_match, &pdev->dev);
if (of_id) {
ops = of_id->data;
ops = of_device_get_match_data(&pdev->dev);
if (ops) {
ret = rspi_parse_dt(&pdev->dev, master);
if (ret)
goto error1;
Expand Down

0 comments on commit 219a7bc

Please sign in to comment.