]> xenbits.xensource.com Git - people/julieng/linux-arm.git/commitdiff
spi: rspi: Use of_device_get_match_data() helper
authorGeert Uytterhoeven <geert+renesas@glider.be>
Wed, 4 Oct 2017 12:19:53 +0000 (14:19 +0200)
committerMark Brown <broonie@kernel.org>
Wed, 4 Oct 2017 14:47:38 +0000 (15:47 +0100)
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>
drivers/spi/spi-rspi.c

index 2a10b3f94ff72a4ea3d6924a082ef6d2db174528..2ce875764ca646a2bdfb803cae33465ab8fa1786 100644 (file)
@@ -1221,7 +1221,6 @@ 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;
 
@@ -1229,9 +1228,8 @@ static int rspi_probe(struct platform_device *pdev)
        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;