ASoC: soc-card: move snd_soc_card_get_codec_dai() to soc-card
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Thu, 28 May 2020 01:48:20 +0000 (10:48 +0900)
committerMark Brown <broonie@kernel.org>
Sat, 30 May 2020 01:11:30 +0000 (02:11 +0100)
Card related function should be implemented at soc-card now.
This patch moves it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/875zcg25jv.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
include/sound/soc-card.h
include/sound/soc.h

index e60ad39b87bded6841470dc298d99be4ec0aa4a5..2e2dd69313d23cf2f1bd4e740508423920cb395f 100644 (file)
@@ -26,4 +26,18 @@ static inline void *snd_soc_card_get_drvdata(struct snd_soc_card *card)
        return card->drvdata;
 }
 
+static inline
+struct snd_soc_dai *snd_soc_card_get_codec_dai(struct snd_soc_card *card,
+                                              const char *dai_name)
+{
+       struct snd_soc_pcm_runtime *rtd;
+
+       for_each_card_rtds(card, rtd) {
+               if (!strcmp(asoc_rtd_to_codec(rtd, 0)->name, dai_name))
+                       return asoc_rtd_to_codec(rtd, 0);
+       }
+
+       return NULL;
+}
+
 #endif /* __SOC_CARD_H */
index 3072298e756a7615432b4e01aa5b1ba4358e8ab8..5c126ab0e32d08f8f3eba009b4d955f54f0fb9a6 100644 (file)
@@ -1372,20 +1372,6 @@ struct snd_soc_dai *snd_soc_find_dai(
 
 #include <sound/soc-dai.h>
 
-static inline
-struct snd_soc_dai *snd_soc_card_get_codec_dai(struct snd_soc_card *card,
-                                              const char *dai_name)
-{
-       struct snd_soc_pcm_runtime *rtd;
-
-       list_for_each_entry(rtd, &card->rtd_list, list) {
-               if (!strcmp(asoc_rtd_to_codec(rtd, 0)->name, dai_name))
-                       return asoc_rtd_to_codec(rtd, 0);
-       }
-
-       return NULL;
-}
-
 static inline
 int snd_soc_fixup_dai_links_platform_name(struct snd_soc_card *card,
                                          const char *platform_name)