summaryrefslogtreecommitdiffstats
path: root/sound/soc/soc-core.c
diff options
context:
space:
mode:
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>2018-09-18 03:29:16 +0200
committerMark Brown <broonie@kernel.org>2018-09-20 19:20:02 +0200
commit98061fdbfccc02aa0fd6637c67a0524aab385b8d (patch)
treecc32efa84f2e26e1a579606af9e314614d630c0a /sound/soc/soc-core.c
parentASoC: add for_each_card_prelinks() macro (diff)
downloadlinux-98061fdbfccc02aa0fd6637c67a0524aab385b8d.tar.xz
linux-98061fdbfccc02aa0fd6637c67a0524aab385b8d.zip
ASoC: add for_each_card_links() macro
To be more readable code, this patch adds new for_each_card_links() 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/soc-core.c')
-rw-r--r--sound/soc/soc-core.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 532d8c59ed1e..495173635642 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -816,7 +816,7 @@ struct snd_soc_dai_link *snd_soc_find_dai_link(struct snd_soc_card *card,
lockdep_assert_held(&client_mutex);
- list_for_each_entry_safe(link, _link, &card->dai_link_list, list) {
+ for_each_card_links_safe(card, link, _link) {
if (link->id != id)
continue;
@@ -1004,7 +1004,7 @@ static void soc_remove_dai_links(struct snd_soc_card *card)
soc_remove_link_components(card, rtd, order);
}
- list_for_each_entry_safe(link, _link, &card->dai_link_list, list) {
+ for_each_card_links_safe(card, link, _link) {
if (link->dobj.type == SND_SOC_DOBJ_DAI_LINK)
dev_warn(card->dev, "Topology forgot to remove link %s?\n",
link->name);
@@ -1219,7 +1219,7 @@ void snd_soc_remove_dai_link(struct snd_soc_card *card,
if (dai_link->dobj.type && card->remove_dai_link)
card->remove_dai_link(card, dai_link);
- list_for_each_entry_safe(link, _link, &card->dai_link_list, list) {
+ for_each_card_links_safe(card, link, _link) {
if (link == dai_link) {
list_del(&link->list);
return;
@@ -2033,7 +2033,7 @@ static int snd_soc_instantiate_card(struct snd_soc_card *card)
/* Find new DAI links added during probing components and bind them.
* Components with topology may bring new DAIs and DAI links.
*/
- list_for_each_entry(dai_link, &card->dai_link_list, list) {
+ for_each_card_links(card, dai_link) {
if (soc_is_dai_link_bound(card, dai_link))
continue;