summaryrefslogtreecommitdiffstats
path: root/sound/soc/mediatek/mt2701/mt2701-wm8960.c
diff options
context:
space:
mode:
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>2018-09-18 01:28:49 +0000
committerMark Brown <broonie@kernel.org>2018-09-20 10:18:34 -0700
commit7fe072b4df5d0cc832eb758c1eed243c145a2dfc (patch)
treeb3b33044d52db6935e7346540cd3ddbf1a3f0ab0 /sound/soc/mediatek/mt2701/mt2701-wm8960.c
parent6d11b12879144da5f5aa08071a8a7f95f3b5a4e8 (diff)
downloadtalos-op-linux-7fe072b4df5d0cc832eb758c1eed243c145a2dfc.tar.gz
talos-op-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/mt2701/mt2701-wm8960.c')
-rw-r--r--sound/soc/mediatek/mt2701/mt2701-wm8960.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/sound/soc/mediatek/mt2701/mt2701-wm8960.c b/sound/soc/mediatek/mt2701/mt2701-wm8960.c
index e5d49e6e2f99..c67f62935e53 100644
--- a/sound/soc/mediatek/mt2701/mt2701-wm8960.c
+++ b/sound/soc/mediatek/mt2701/mt2701-wm8960.c
@@ -97,6 +97,7 @@ static int mt2701_wm8960_machine_probe(struct platform_device *pdev)
{
struct snd_soc_card *card = &mt2701_wm8960_card;
struct device_node *platform_node, *codec_node;
+ struct snd_soc_dai_link *dai_link;
int ret, i;
platform_node = of_parse_phandle(pdev->dev.of_node,
@@ -105,10 +106,10 @@ static int mt2701_wm8960_machine_probe(struct platform_device *pdev)
dev_err(&pdev->dev, "Property 'platform' missing or invalid\n");
return -EINVAL;
}
- for (i = 0; i < card->num_links; i++) {
- if (mt2701_wm8960_dai_links[i].platform_name)
+ for_each_card_prelinks(card, i, dai_link) {
+ if (dai_links->platform_name)
continue;
- mt2701_wm8960_dai_links[i].platform_of_node = platform_node;
+ dai_links->platform_of_node = platform_node;
}
card->dev = &pdev->dev;
@@ -120,10 +121,10 @@ static int mt2701_wm8960_machine_probe(struct platform_device *pdev)
"Property 'audio-codec' missing or invalid\n");
return -EINVAL;
}
- for (i = 0; i < card->num_links; i++) {
- if (mt2701_wm8960_dai_links[i].codec_name)
+ for_each_card_prelinks(card, i, dai_link) {
+ if (dai_links->codec_name)
continue;
- mt2701_wm8960_dai_links[i].codec_of_node = codec_node;
+ dai_links->codec_of_node = codec_node;
}
ret = snd_soc_of_parse_audio_routing(card, "audio-routing");
OpenPOWER on IntegriCloud