summaryrefslogtreecommitdiffstats
path: root/sound/soc/meson
diff options
context:
space:
mode:
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>2018-09-03 02:12:56 +0000
committerMark Brown <broonie@kernel.org>2018-09-04 16:59:11 +0100
commit0b7990e38971da403ce223d8bdc758a817eb72f8 (patch)
treeacaec9b0b94b9f7a8823b665cab92502eda84bd8 /sound/soc/meson
parent3db769f17714ae65f2faf44ff2bae9d52f4bd46b (diff)
downloadlinux-0b7990e38971da403ce223d8bdc758a817eb72f8.tar.gz
linux-0b7990e38971da403ce223d8bdc758a817eb72f8.tar.bz2
linux-0b7990e38971da403ce223d8bdc758a817eb72f8.zip
ASoC: add for_each_rtd_codec_dai() macro
ALSA SoC snd_soc_pcm_runtime has snd_soc_dai array for codec_dai. To be more readable code, this patch adds new for_each_rtd_codec_dai() macro, and replace existing code to it. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/meson')
-rw-r--r--sound/soc/meson/axg-card.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/sound/soc/meson/axg-card.c b/sound/soc/meson/axg-card.c
index 3e68f1aa68ff..197e10a96e28 100644
--- a/sound/soc/meson/axg-card.c
+++ b/sound/soc/meson/axg-card.c
@@ -168,8 +168,7 @@ static int axg_card_tdm_be_hw_params(struct snd_pcm_substream *substream,
if (be->mclk_fs) {
mclk = params_rate(params) * be->mclk_fs;
- for (i = 0; i < rtd->num_codecs; i++) {
- codec_dai = rtd->codec_dais[i];
+ for_each_rtd_codec_dai(rtd, i, codec_dai) {
ret = snd_soc_dai_set_sysclk(codec_dai, 0, mclk,
SND_SOC_CLOCK_IN);
if (ret && ret != -ENOTSUPP)
@@ -197,8 +196,7 @@ static int axg_card_tdm_dai_init(struct snd_soc_pcm_runtime *rtd)
struct snd_soc_dai *codec_dai;
int ret, i;
- for (i = 0; i < rtd->num_codecs; i++) {
- codec_dai = rtd->codec_dais[i];
+ for_each_rtd_codec_dai(rtd, i, codec_dai) {
ret = snd_soc_dai_set_tdm_slot(codec_dai,
be->codec_masks[i].tx,
be->codec_masks[i].rx,