ASoC: meson: axg-card: remove useless check on codec
authorJerome Brunet <jbrunet@baylibre.com>
Fri, 28 Jun 2019 08:17:08 +0000 (10:17 +0200)
committerMark Brown <broonie@kernel.org>
Fri, 28 Jun 2019 12:43:32 +0000 (13:43 +0100)
While checking cpus before dereferencing the pointer is required, it is
not necessary for codecs. 'codec' can't possibly be NULL in the loop

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/meson/axg-card.c

index 70bb0cbad2332f98e54e48e6e34c6e2f0efdbb95..14a8321744daf80ec93db9b30de168d84a591255 100644 (file)
@@ -118,8 +118,7 @@ static void axg_card_clean_references(struct axg_card *priv)
                        if (link->cpus)
                                of_node_put(link->cpus->of_node);
                        for_each_link_codecs(link, j, codec)
-                               if (codec)
-                                       of_node_put(codec->of_node);
+                               of_node_put(codec->of_node);
                }
        }