]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commitdiff
ASoC: soc-core: use for_each_link_codecs() for dai_link codecs
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Mon, 21 Jan 2019 00:32:59 +0000 (09:32 +0900)
committerMark Brown <broonie@kernel.org>
Mon, 21 Jan 2019 18:14:02 +0000 (18:14 +0000)
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

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

index 8a58fa86675ac57a29d4a7354d6c0e78e4fb5766..1c92b4aff57b51f5721d1beb3f5c8d05e5c7fa7b 100644 (file)
@@ -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,9 +905,8 @@ 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++) {
+       for_each_link_codecs(dai_link, i, codecs) {
                codec_dais[i] = snd_soc_find_dai(&codecs[i]);
                if (!codec_dais[i]) {
                        dev_info(card->dev, "ASoC: CODEC DAI %s not registered\n",