summaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorCharles Keepax <ckeepax@opensource.cirrus.com>2020-04-09 19:12:09 +0100
committerMark Brown <broonie@kernel.org>2020-04-14 15:45:25 +0100
commit0eaef95e3cef1f849e8873f929bef3039409c4fc (patch)
tree0b5d5d847b267cbff46abef4d348cf57943e6400 /sound
parent9a1bb600ecafcb07391c83f7c31057abdd3757b7 (diff)
downloadlinux-0eaef95e3cef1f849e8873f929bef3039409c4fc.tar.gz
linux-0eaef95e3cef1f849e8873f929bef3039409c4fc.tar.bz2
linux-0eaef95e3cef1f849e8873f929bef3039409c4fc.zip
ASoC: dapm: Remove dapm_connect_dai_link_widgets helper
This helper is adding very little both it and is one caller are very small functions simply combine the two. Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com> Link: https://lore.kernel.org/r/20200409181209.30130-3-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/soc-dapm.c36
1 files changed, 14 insertions, 22 deletions
diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c
index 33168980619b..a4143ca190d0 100644
--- a/sound/soc/soc-dapm.c
+++ b/sound/soc/soc-dapm.c
@@ -4358,27 +4358,6 @@ capture:
}
}
-static void dapm_connect_dai_link_widgets(struct snd_soc_card *card,
- struct snd_soc_pcm_runtime *rtd)
-{
- struct snd_soc_dai *codec_dai;
- int i;
-
- if (rtd->num_cpus == 1) {
- for_each_rtd_codec_dais(rtd, i, codec_dai)
- dapm_connect_dai_pair(card, rtd, codec_dai,
- rtd->cpu_dais[0]);
- } else if (rtd->num_codecs == rtd->num_cpus) {
- for_each_rtd_codec_dais(rtd, i, codec_dai)
- dapm_connect_dai_pair(card, rtd, codec_dai,
- rtd->cpu_dais[i]);
- } else {
- dev_err(card->dev,
- "N cpus to M codecs link is not supported yet\n");
- }
-
-}
-
static void soc_dapm_dai_stream_event(struct snd_soc_dai *dai, int stream,
int event)
{
@@ -4419,6 +4398,8 @@ static void soc_dapm_dai_stream_event(struct snd_soc_dai *dai, int stream,
void snd_soc_dapm_connect_dai_link_widgets(struct snd_soc_card *card)
{
struct snd_soc_pcm_runtime *rtd;
+ struct snd_soc_dai *codec_dai;
+ int i;
/* for each BE DAI link... */
for_each_card_rtds(card, rtd) {
@@ -4429,7 +4410,18 @@ void snd_soc_dapm_connect_dai_link_widgets(struct snd_soc_card *card)
if (rtd->dai_link->dynamic)
continue;
- dapm_connect_dai_link_widgets(card, rtd);
+ if (rtd->num_cpus == 1) {
+ for_each_rtd_codec_dais(rtd, i, codec_dai)
+ dapm_connect_dai_pair(card, rtd, codec_dai,
+ rtd->cpu_dais[0]);
+ } else if (rtd->num_codecs == rtd->num_cpus) {
+ for_each_rtd_codec_dais(rtd, i, codec_dai)
+ dapm_connect_dai_pair(card, rtd, codec_dai,
+ rtd->cpu_dais[i]);
+ } else {
+ dev_err(card->dev,
+ "N cpus to M codecs link is not supported yet\n");
+ }
}
}