diff options
author | Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> | 2019-01-28 02:40:24 +0100 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2019-01-28 13:33:05 +0100 |
commit | 720734a0b66f9ca42ec6663a48702b16e49552ee (patch) | |
tree | 84671016d654bc84c7279e5ffea062cb17ed542b /sound/soc/soc-core.c | |
parent | ASoC: Fixup build error for mt6358 (diff) | |
download | linux-720734a0b66f9ca42ec6663a48702b16e49552ee.tar.xz linux-720734a0b66f9ca42ec6663a48702b16e49552ee.zip |
ASoC: soc-core: use for_each_link_codecs() for dai_link codecs V2
We can use for_each_link_codecs() without waiting
for_each_rtd_codec_dai() on soc_bind_dai_link().
Let's use for_each macro.
Fixes: 50acc7e49 ("ASoC: core: Fix multi-CODEC setups")
Fixes: 10dff9b0d ("ASoC: soc-core: use for_each_link_codecs() for dai_link codecs")
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tested-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/soc-core.c')
-rw-r--r-- | sound/soc/soc-core.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index 8a58fa86675a..93efab486736 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -870,7 +870,7 @@ static int soc_bind_dai_link(struct snd_soc_card *card, struct snd_soc_dai_link *dai_link) { struct snd_soc_pcm_runtime *rtd; - struct snd_soc_dai_link_component *codecs = dai_link->codecs; + struct snd_soc_dai_link_component *codecs; struct snd_soc_dai_link_component cpu_dai_component; struct snd_soc_component *component; struct snd_soc_dai **codec_dais; @@ -905,13 +905,12 @@ static int soc_bind_dai_link(struct snd_soc_card *card, rtd->num_codecs = dai_link->num_codecs; /* Find CODEC from registered CODECs */ - /* we can use for_each_rtd_codec_dai() after this */ codec_dais = rtd->codec_dais; - for (i = 0; i < rtd->num_codecs; i++) { - codec_dais[i] = snd_soc_find_dai(&codecs[i]); + for_each_link_codecs(dai_link, i, codecs) { + codec_dais[i] = snd_soc_find_dai(codecs); if (!codec_dais[i]) { dev_info(card->dev, "ASoC: CODEC DAI %s not registered\n", - codecs[i].dai_name); + codecs->dai_name); goto _err_defer; } snd_soc_rtdcom_add(rtd, codec_dais[i]->component); |