diff options
author | Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> | 2018-09-18 01:28:49 +0000 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2018-09-20 10:18:34 -0700 |
commit | 7fe072b4df5d0cc832eb758c1eed243c145a2dfc (patch) | |
tree | b3b33044d52db6935e7346540cd3ddbf1a3f0ab0 /sound/soc/mediatek/mt8173/mt8173-rt5650-rt5676.c | |
parent | 6d11b12879144da5f5aa08071a8a7f95f3b5a4e8 (diff) | |
download | blackbird-obmc-linux-7fe072b4df5d0cc832eb758c1eed243c145a2dfc.tar.gz blackbird-obmc-linux-7fe072b4df5d0cc832eb758c1eed243c145a2dfc.zip |
ASoC: add for_each_card_prelinks() macro
To be more readable code, this patch adds
new for_each_card_prelinks() 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/mediatek/mt8173/mt8173-rt5650-rt5676.c')
-rw-r--r-- | sound/soc/mediatek/mt8173/mt8173-rt5650-rt5676.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/sound/soc/mediatek/mt8173/mt8173-rt5650-rt5676.c b/sound/soc/mediatek/mt8173/mt8173-rt5650-rt5676.c index 82675ed057de..d83cd039b413 100644 --- a/sound/soc/mediatek/mt8173/mt8173-rt5650-rt5676.c +++ b/sound/soc/mediatek/mt8173/mt8173-rt5650-rt5676.c @@ -224,6 +224,7 @@ static int mt8173_rt5650_rt5676_dev_probe(struct platform_device *pdev) { struct snd_soc_card *card = &mt8173_rt5650_rt5676_card; struct device_node *platform_node; + struct snd_soc_dai_link *dai_link; int i, ret; platform_node = of_parse_phandle(pdev->dev.of_node, @@ -233,10 +234,10 @@ static int mt8173_rt5650_rt5676_dev_probe(struct platform_device *pdev) return -EINVAL; } - for (i = 0; i < card->num_links; i++) { - if (mt8173_rt5650_rt5676_dais[i].platform_name) + for_each_card_prelinks(card, i, dai_link) { + if (dai_link->platform_name) continue; - mt8173_rt5650_rt5676_dais[i].platform_of_node = platform_node; + dai_link->platform_of_node = platform_node; } mt8173_rt5650_rt5676_codecs[0].of_node = |