summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAjit Pandey <ajitp@codeaurora.org>2019-01-09 09:47:07 +0100
committerMark Brown <broonie@kernel.org>2019-01-09 13:33:56 +0100
commit8780cf1142a59568a3aa77959cbd76b2edb6fd81 (patch)
tree3dd4fa87d7ccbe6bf003ca737b41125a20a8e4f3
parentASoC: atom: fix a missing check of snd_pcm_lib_malloc_pages (diff)
downloadlinux-8780cf1142a59568a3aa77959cbd76b2edb6fd81.tar.xz
linux-8780cf1142a59568a3aa77959cbd76b2edb6fd81.zip
ASoC: soc-core: defer card probe until all component is added to list
DAI component probe is not called if it is not present in component list during sound card registration. Check if component is available in component list for platform and cpu dai before soundcard registration. Signed-off-by: Ajit Pandey <ajitp@codeaurora.org> Signed-off-by: Rohit kumar <rohitkr@codeaurora.org> Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r--sound/soc/soc-core.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 0462b3ec977a..eec92f17dd15 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -1027,7 +1027,6 @@ static int snd_soc_init_platform(struct snd_soc_card *card,
struct snd_soc_dai_link *dai_link)
{
struct snd_soc_dai_link_component *platform = dai_link->platform;
-
/*
* FIXME
*
@@ -1129,6 +1128,14 @@ static int soc_init_dai_link(struct snd_soc_card *card,
link->name);
return -EINVAL;
}
+
+ /*
+ * Defer card registartion if platform dai component is not added to
+ * component list.
+ */
+ if (!soc_find_component(link->platform->of_node, link->platform->name))
+ return -EPROBE_DEFER;
+
/*
* CPU device may be specified by either name or OF node, but
* can be left unspecified, and will be matched based on DAI
@@ -1140,6 +1147,14 @@ static int soc_init_dai_link(struct snd_soc_card *card,
link->name);
return -EINVAL;
}
+
+ /*
+ * Defer card registartion if cpu dai component is not added to
+ * component list.
+ */
+ if (!soc_find_component(link->cpu_of_node, link->cpu_name))
+ return -EPROBE_DEFER;
+
/*
* At least one of CPU DAI name or CPU device name/node must be
* specified