((i) < (card)->num_links) && ((link) = &(card)->dai_link[i]); \
(i)++)
+#define for_each_card_links(card, link) \
+ list_for_each_entry(dai_link, &(card)->dai_link_list, list)
+#define for_each_card_links_safe(card, link, _link) \
+ list_for_each_entry_safe(link, _link, &(card)->dai_link_list, list)
+
+
/* SoC machine DAI configuration, glues a codec and cpu DAI together */
struct snd_soc_pcm_runtime {
struct device *dev;
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;
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);
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;
/* 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;