summaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>2020-05-28 10:50:41 +0900
committerMark Brown <broonie@kernel.org>2020-05-30 02:11:41 +0100
commitcbc7a6b5a87a129084c643455d16699ea490fd2f (patch)
treeb474a84aac20d008327d998f3065024ef7d2112c /sound
parentd41278ea0579a8c1e216c5321e2d207705ab3b54 (diff)
ASoC: soc-card: add snd_soc_card_add_dai_link()
Card related function should be implemented at soc-card now. This patch adds it. This patch adds missing return when error case. 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/87o8q8zv2m.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/soc-card.c12
-rw-r--r--sound/soc/soc-core.c5
2 files changed, 15 insertions, 2 deletions
diff --git a/sound/soc/soc-card.c b/sound/soc/soc-card.c
index 5bc2832b3505..ba84a55fa80d 100644
--- a/sound/soc/soc-card.c
+++ b/sound/soc/soc-card.c
@@ -203,3 +203,15 @@ int snd_soc_card_set_bias_level_post(struct snd_soc_card *card,
return soc_card_ret(card, ret);
}
+
+int snd_soc_card_add_dai_link(struct snd_soc_card *card,
+ struct snd_soc_dai_link *dai_link)
+{
+ int ret = 0;
+
+ if (card->add_dai_link)
+ ret = card->add_dai_link(card, dai_link);
+
+ return soc_card_ret(card, ret);
+}
+EXPORT_SYMBOL_GPL(snd_soc_card_add_dai_link);
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 136ff7237a80..d238b47252a5 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -978,8 +978,9 @@ int snd_soc_add_pcm_runtime(struct snd_soc_card *card,
/*
* Notify the machine driver for extra initialization
*/
- if (card->add_dai_link)
- card->add_dai_link(card, dai_link);
+ ret = snd_soc_card_add_dai_link(card, dai_link);
+ if (ret < 0)
+ return ret;
if (dai_link->ignore)
return 0;