Skip to content

Commit 65a7571

Browse files
morimotobroonie
authored andcommitted
ASoC: soc-card: move snd_soc_card_get_codec_dai() to soc-card
Card related function should be implemented at soc-card now. This patch moves it. Signed-off-by: Kuninori Morimoto <[email protected]> Reviewed-by: Ranjani Sridharan <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent 63efed5 commit 65a7571

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

include/sound/soc-card.h

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,18 @@ static inline void *snd_soc_card_get_drvdata(struct snd_soc_card *card)
2626
return card->drvdata;
2727
}
2828

29+
static inline
30+
struct snd_soc_dai *snd_soc_card_get_codec_dai(struct snd_soc_card *card,
31+
const char *dai_name)
32+
{
33+
struct snd_soc_pcm_runtime *rtd;
34+
35+
for_each_card_rtds(card, rtd) {
36+
if (!strcmp(asoc_rtd_to_codec(rtd, 0)->name, dai_name))
37+
return asoc_rtd_to_codec(rtd, 0);
38+
}
39+
40+
return NULL;
41+
}
42+
2943
#endif /* __SOC_CARD_H */

include/sound/soc.h

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1372,20 +1372,6 @@ struct snd_soc_dai *snd_soc_find_dai(
13721372

13731373
#include <sound/soc-dai.h>
13741374

1375-
static inline
1376-
struct snd_soc_dai *snd_soc_card_get_codec_dai(struct snd_soc_card *card,
1377-
const char *dai_name)
1378-
{
1379-
struct snd_soc_pcm_runtime *rtd;
1380-
1381-
list_for_each_entry(rtd, &card->rtd_list, list) {
1382-
if (!strcmp(asoc_rtd_to_codec(rtd, 0)->name, dai_name))
1383-
return asoc_rtd_to_codec(rtd, 0);
1384-
}
1385-
1386-
return NULL;
1387-
}
1388-
13891375
static inline
13901376
int snd_soc_fixup_dai_links_platform_name(struct snd_soc_card *card,
13911377
const char *platform_name)

0 commit comments

Comments
 (0)