未验证 提交 2833548e 编写于 作者: M Matthias Reichl 提交者: Mark Brown

ASoC: core: Don't defer probe on optional, NULL components

cpu and platform are optional components in DAI links. For example
codec-codec links usually have no platform set.

Call snd_soc_find_component only if the name or of_node of
a cpu or platform is set. Otherwise it will return NULL and
soc_init_dai_link bails out immediately with -EPROBE_DEFER,
meaning registering a card with NULL cpu or platform in DAI links
can never succeed.

Fixes: 8780cf11 ("ASoC: soc-core: defer card probe until all component is added to list")
Signed-off-by: NMatthias Reichl <hias@horus.com>
Signed-off-by: NMark Brown <broonie@kernel.org>
上级 5a7b2aab
...@@ -1135,7 +1135,8 @@ static int soc_init_dai_link(struct snd_soc_card *card, ...@@ -1135,7 +1135,8 @@ static int soc_init_dai_link(struct snd_soc_card *card,
* Defer card registartion if platform dai component is not added to * Defer card registartion if platform dai component is not added to
* component list. * component list.
*/ */
if (!soc_find_component(link->platform->of_node, link->platform->name)) if ((link->platform->of_node || link->platform->name) &&
!soc_find_component(link->platform->of_node, link->platform->name))
return -EPROBE_DEFER; return -EPROBE_DEFER;
/* /*
...@@ -1154,7 +1155,8 @@ static int soc_init_dai_link(struct snd_soc_card *card, ...@@ -1154,7 +1155,8 @@ static int soc_init_dai_link(struct snd_soc_card *card,
* Defer card registartion if cpu dai component is not added to * Defer card registartion if cpu dai component is not added to
* component list. * component list.
*/ */
if (!soc_find_component(link->cpu_of_node, link->cpu_name)) if ((link->cpu_of_node || link->cpu_name) &&
!soc_find_component(link->cpu_of_node, link->cpu_name))
return -EPROBE_DEFER; return -EPROBE_DEFER;
/* /*
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册