提交 124512ce 编写于 作者: S Shengjiu Wang 提交者: Zheng Zengkai

ASoC: soc-core: skip zero num_dai component in searching dai name

stable inclusion
from stable-v5.10.110
commit 460635026801b286e88c6bf96431e3aa4fa56558
bugzilla: https://gitee.com/openeuler/kernel/issues/I574AL

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=460635026801b286e88c6bf96431e3aa4fa56558

--------------------------------

[ Upstream commit f7d344a2 ]

In the case like dmaengine which's not a dai but as a component, the
num_dai is zero, dmaengine component has the same component_of_node
as cpu dai, when cpu dai component is not ready, but dmaengine component
is ready, try to get cpu dai name, the snd_soc_get_dai_name() return
-EINVAL, not -EPROBE_DEFER, that cause below error:

asoc-simple-card <card name>: parse error -22
asoc-simple-card: probe of <card name> failed with error -22

The sound card failed to probe.

So this patch fixes the issue above by skipping the zero num_dai
component in searching dai name.
Signed-off-by: NShengjiu Wang <shengjiu.wang@nxp.com>
Link: https://lore.kernel.org/r/1644491952-7457-1-git-send-email-shengjiu.wang@nxp.comSigned-off-by: NMark Brown <broonie@kernel.org>
Signed-off-by: NSasha Levin <sashal@kernel.org>
Signed-off-by: NYu Liao <liaoyu15@huawei.com>
Reviewed-by: NWei Li <liwei391@huawei.com>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 f8fce7f7
...@@ -3020,7 +3020,7 @@ int snd_soc_get_dai_name(struct of_phandle_args *args, ...@@ -3020,7 +3020,7 @@ int snd_soc_get_dai_name(struct of_phandle_args *args,
for_each_component(pos) { for_each_component(pos) {
component_of_node = soc_component_to_node(pos); component_of_node = soc_component_to_node(pos);
if (component_of_node != args->np) if (component_of_node != args->np || !pos->num_dai)
continue; continue;
ret = snd_soc_component_of_xlate_dai_name(pos, args, dai_name); ret = snd_soc_component_of_xlate_dai_name(pos, args, dai_name);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册