Commit 3af6ff50 authored by Kuninori Morimoto's avatar Kuninori Morimoto Committed by Mark Brown

ASoC: soc-core: Merge for_each_rtd_cpu/codec_dais()

Now we can use for_each_rtd_dais().
Let's use it instead of for_each_rtd_cpu/codec_dais().
Signed-off-by: default avatarKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: default avatarRanjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: default avatarPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/87v9n4olf4.wl-kuninori.morimoto.gx@renesas.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 22a2fc81
...@@ -1323,26 +1323,22 @@ static int soc_probe_dai(struct snd_soc_dai *dai, int order) ...@@ -1323,26 +1323,22 @@ static int soc_probe_dai(struct snd_soc_dai *dai, int order)
static void soc_remove_link_dais(struct snd_soc_card *card) static void soc_remove_link_dais(struct snd_soc_card *card)
{ {
int i; int i;
struct snd_soc_dai *codec_dai; struct snd_soc_dai *dai;
struct snd_soc_dai *cpu_dai;
struct snd_soc_pcm_runtime *rtd; struct snd_soc_pcm_runtime *rtd;
int order; int order;
for_each_comp_order(order) { for_each_comp_order(order) {
for_each_card_rtds(card, rtd) { for_each_card_rtds(card, rtd) {
/* remove the CODEC DAI */ /* remove DAIs */
for_each_rtd_codec_dais(rtd, i, codec_dai) for_each_rtd_dais(rtd, i, dai)
soc_remove_dai(codec_dai, order); soc_remove_dai(dai, order);
for_each_rtd_cpu_dais(rtd, i, cpu_dai)
soc_remove_dai(cpu_dai, order);
} }
} }
} }
static int soc_probe_link_dais(struct snd_soc_card *card) static int soc_probe_link_dais(struct snd_soc_card *card)
{ {
struct snd_soc_dai *codec_dai, *cpu_dai; struct snd_soc_dai *dai;
struct snd_soc_pcm_runtime *rtd; struct snd_soc_pcm_runtime *rtd;
int i, order, ret; int i, order, ret;
...@@ -1354,15 +1350,8 @@ static int soc_probe_link_dais(struct snd_soc_card *card) ...@@ -1354,15 +1350,8 @@ static int soc_probe_link_dais(struct snd_soc_card *card)
card->name, rtd->num, order); card->name, rtd->num, order);
/* probe the CPU DAI */ /* probe the CPU DAI */
for_each_rtd_cpu_dais(rtd, i, cpu_dai) { for_each_rtd_dais(rtd, i, dai) {
ret = soc_probe_dai(cpu_dai, order); ret = soc_probe_dai(dai, order);
if (ret)
return ret;
}
/* probe the CODEC DAI */
for_each_rtd_codec_dais(rtd, i, codec_dai) {
ret = soc_probe_dai(codec_dai, order);
if (ret) if (ret)
return ret; return ret;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment