ASoC: sh: rcar: core: don't open code of_device_get_match_data()
authorWolfram Sang <wsa+renesas@sang-engineering.com>
Tue, 1 Mar 2016 16:39:19 +0000 (17:39 +0100)
committerMark Brown <broonie@kernel.org>
Wed, 2 Mar 2016 11:02:44 +0000 (20:02 +0900)
This change will also make Coverity happy by avoiding a theoretical NULL
pointer dereference; yet another reason is to use the above helper function
to tighten the code and make it more readable.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Acked-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/sh/rcar/core.c

index 21e13b3a356fbb402cfc7ed6350005f88a483c25..ba37b0d55b21862db9e109f2f2e56a9ca683e8df 100644 (file)
@@ -1119,7 +1119,6 @@ static int rsnd_probe(struct platform_device *pdev)
        struct rsnd_priv *priv;
        struct device *dev = &pdev->dev;
        struct rsnd_dai *rdai;
-       const struct of_device_id *of_id = of_match_device(rsnd_of_match, dev);
        int (*probe_func[])(struct rsnd_priv *priv) = {
                rsnd_gen_probe,
                rsnd_dma_probe,
@@ -1145,7 +1144,7 @@ static int rsnd_probe(struct platform_device *pdev)
        }
 
        priv->pdev      = pdev;
-       priv->flags     = (unsigned long)of_id->data;
+       priv->flags     = (unsigned long)of_device_get_match_data(dev);
        spin_lock_init(&priv->lock);
 
        /*