Merge remote-tracking branches 'asoc/topic/simple', 'asoc/topic/spear', 'asoc/topic...
[sfrench/cifs-2.6.git] / sound / soc / generic / audio-graph-card.c
index 63048915efbb912a8cbda8e22517dd149f21826c..488c52f9405fcd2fb7ec909d7fdda4bbf8b36e81 100644 (file)
@@ -95,7 +95,7 @@ static void asoc_graph_card_shutdown(struct snd_pcm_substream *substream)
        asoc_simple_card_clk_disable(&dai_props->codec_dai);
 }
 
        asoc_simple_card_clk_disable(&dai_props->codec_dai);
 }
 
-static struct snd_soc_ops asoc_graph_card_ops = {
+static const struct snd_soc_ops asoc_graph_card_ops = {
        .startup = asoc_graph_card_startup,
        .shutdown = asoc_graph_card_shutdown,
 };
        .startup = asoc_graph_card_startup,
        .shutdown = asoc_graph_card_shutdown,
 };
@@ -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_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 ret;
+               }
        }
 
        return asoc_simple_card_parse_card_name(card, NULL);
        }
 
        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;
 
        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++;
                count++;
-               of_node_put(it.node);
-       }
 
        return count;
 }
 
        return count;
 }