All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ASoC: soc-core: skip zero num_dai component in searching dai name
@ 2022-02-10 11:19 Shengjiu Wang
  2022-02-15 13:18 ` Mark Brown
  0 siblings, 1 reply; 2+ messages in thread
From: Shengjiu Wang @ 2022-02-10 11:19 UTC (permalink / raw)
  To: lgirdwood, broonie, perex, tiwai, alsa-devel, linux-kernel

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: Shengjiu Wang <shengjiu.wang@nxp.com>
---
 sound/soc/soc-core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 434e61b46983..a088bc9f7dd7 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -3233,7 +3233,7 @@ int snd_soc_get_dai_name(const struct of_phandle_args *args,
 	for_each_component(pos) {
 		struct device_node *component_of_node = soc_component_to_node(pos);
 
-		if (component_of_node != args->np)
+		if (component_of_node != args->np || !pos->num_dai)
 			continue;
 
 		ret = snd_soc_component_of_xlate_dai_name(pos, args, dai_name);
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] ASoC: soc-core: skip zero num_dai component in searching dai name
  2022-02-10 11:19 [PATCH] ASoC: soc-core: skip zero num_dai component in searching dai name Shengjiu Wang
@ 2022-02-15 13:18 ` Mark Brown
  0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2022-02-15 13:18 UTC (permalink / raw)
  To: lgirdwood, alsa-devel, tiwai, perex, linux-kernel, Shengjiu Wang

On Thu, 10 Feb 2022 19:19:12 +0800, Shengjiu Wang wrote:
> 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
> 
> [...]

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next

Thanks!

[1/1] ASoC: soc-core: skip zero num_dai component in searching dai name
      commit: f7d344a2bd5ec81fbd1ce76928fd059e57ec9bea

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-02-15 13:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-10 11:19 [PATCH] ASoC: soc-core: skip zero num_dai component in searching dai name Shengjiu Wang
2022-02-15 13:18 ` Mark Brown

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.