]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
ASoC: soc-card: add snd_soc_card_add_dai_link()
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Thu, 28 May 2020 01:50:41 +0000 (10:50 +0900)
committerMark Brown <broonie@kernel.org>
Sat, 30 May 2020 01:11:41 +0000 (02:11 +0100)
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>
include/sound/soc-card.h
sound/soc/soc-card.c
sound/soc/soc-core.c

index e35f777fd8cc63a507b106a94af823fb90bead85..f7e5c0ec5dc537a936ffb058c4130fb983cd6ccf 100644 (file)
@@ -35,6 +35,9 @@ int snd_soc_card_set_bias_level_post(struct snd_soc_card *card,
                                     struct snd_soc_dapm_context *dapm,
                                     enum snd_soc_bias_level level);
 
+int snd_soc_card_add_dai_link(struct snd_soc_card *card,
+                             struct snd_soc_dai_link *dai_link);
+
 /* device driver data */
 static inline void snd_soc_card_set_drvdata(struct snd_soc_card *card,
                                            void *data)
index 5bc2832b35051ef1f46a55933635c162fa695c26..ba84a55fa80da08f81dd6424b45a9ac700c13c97 100644 (file)
@@ -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);
index 136ff7237a808c287a5f1217397df5e550f14ec8..d238b47252a5692aedd5aaf1cfa46e7570f32fba 100644 (file)
@@ -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;