]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - sound/soc/generic/audio-graph-card.c
Merge tag 'char-misc-4.13-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregk...
[karo-tx-linux.git] / sound / soc / generic / audio-graph-card.c
index 105ec3a6e30df8340d62d1be45e1bb8577956672..de2550c7a96b095d33e449232087ef2d3b6e4655 100644 (file)
@@ -224,9 +224,11 @@ static int asoc_graph_card_parse_of(struct graph_card_data *priv)
 
        of_for_each_phandle(&it, rc, node, "dais", NULL, 0) {
                ret = asoc_graph_card_dai_link_of(it.node, priv, idx++);
-               of_node_put(it.node);
-               if (ret < 0)
+               if (ret < 0) {
+                       of_node_put(it.node);
+
                        return ret;
+               }
        }
 
        return asoc_simple_card_parse_card_name(card, NULL);
@@ -239,10 +241,8 @@ static int asoc_graph_get_dais_count(struct device *dev)
        int count = 0;
        int rc;
 
-       of_for_each_phandle(&it, rc, node, "dais", NULL, 0) {
+       of_for_each_phandle(&it, rc, node, "dais", NULL, 0)
                count++;
-               of_node_put(it.node);
-       }
 
        return count;
 }