ASoC: audio-graph-scu-card: tidyup asoc_simple_card_canonicalize_cpu() parameter
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Thu, 22 Jun 2017 06:22:14 +0000 (06:22 +0000)
committerMark Brown <broonie@kernel.org>
Fri, 23 Jun 2017 12:02:59 +0000 (13:02 +0100)
asoc_simple_card_canonicalize_cpu() 2nd param is asking CPU component's
DAI links, not Card links.
This patch fixup it. Otherwise, audio-graph-card can't handle CPU
component correctly if CPU has mult-DAIs and Card uses only one of them

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/generic/audio-graph-scu-card.c

index 05934b24627bfbdcf78f611e8d4189dad7c7644f..061c7a60d6b4767df57eb04abba00d9e5a214fe7 100644 (file)
@@ -125,7 +125,7 @@ static int asoc_graph_card_dai_link_of(struct device_node *ep,
 
                /* card->num_links includes Codec */
                asoc_simple_card_canonicalize_cpu(dai_link,
-                                       (card->num_links - 1) == 1);
+                       of_graph_get_endpoint_count(dai_link->cpu_of_node) == 1);
        } else {
                /* FE is dummy */
                dai_link->cpu_of_node           = NULL;