summaryrefslogtreecommitdiff
path: root/include/sound/soc.h
diff options
context:
space:
mode:
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>2023-01-31 01:59:27 +0000
committerMark Brown <broonie@kernel.org>2023-01-31 11:04:53 +0000
commit2e5f86174e31cc1eda92b308f23f3b29684b339e (patch)
tree7f6d0820c600733bde0caba29b857508bf27a5d0 /include/sound/soc.h
parent944d721ee5defb376410c7054a7db0a0ef5ff584 (diff)
ASoC: soc.h: add snd_soc_card_is_instantiated() helper
ASoC framework/driver checks whether card was instantiated every where. Then, it should check card pointer too in such case. This patch adds snd_soc_card_is_instantiated() for it. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com> Link: https://lore.kernel.org/r/875ycnfoqp.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'include/sound/soc.h')
-rw-r--r--include/sound/soc.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/sound/soc.h b/include/sound/soc.h
index 37bbfc8b45cb..e58b43b5da7c 100644
--- a/include/sound/soc.h
+++ b/include/sound/soc.h
@@ -1052,6 +1052,12 @@ struct snd_soc_card {
#define for_each_card_widgets_safe(card, w, _w) \
list_for_each_entry_safe(w, _w, &card->widgets, list)
+
+static inline int snd_soc_card_is_instantiated(struct snd_soc_card *card)
+{
+ return card && card->instantiated;
+}
+
/* SoC machine DAI configuration, glues a codec and cpu DAI together */
struct snd_soc_pcm_runtime {
struct device *dev;