linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ASoC: soc-component: don't report of_xlate_dai_name failures
@ 2020-07-23 14:20 Jerome Brunet
  2020-07-24 14:37 ` Mark Brown
  0 siblings, 1 reply; 2+ messages in thread
From: Jerome Brunet @ 2020-07-23 14:20 UTC (permalink / raw)
  To: Mark Brown, Liam Girdwood
  Cc: Jerome Brunet, alsa-devel, linux-kernel, Kuninori Morimoto

With commit e2329eeba45f ("ASoC: soc-component: add soc_component_err()")
every error different for ENOTSUPP or EPROBE_DEFER will log an error.

However, as explained in snd_soc_get_dai_name(), this callback may error
to indicate that the DAI is not matched by the component tested. If the
device provides other components, those may still match. Logging an error
in this case is misleading.

Don't use soc_component_ret() in snd_soc_component_of_xlate_dai_name()
to avoid spamming the log.

Fixes: e2329eeba45f ("ASoC: soc-component: add soc_component_err()")
Cc: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
---

 If we wish to report an error when no name is found for dai phandle,
 I think it would be more approriate to it with with "struct device *"
 of the card, which is the one actually failing to get what it needs.

 These user of snd_soc_get_dai_name() are already reporting the error:
 * sound/soc/samsung/tm2_wm5110.c
 * sound/soc/rockchip/rk3288_hdmi_analog.c

 These could be silently failing:
 * Simple cards
 * Amlogic's cards
 * Samsumg odroid card

 sound/soc/soc-component.c | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/sound/soc/soc-component.c b/sound/soc/soc-component.c
index 9565a0dd7cb6..fb6479b22d26 100644
--- a/sound/soc/soc-component.c
+++ b/sound/soc/soc-component.c
@@ -344,13 +344,15 @@ int snd_soc_component_of_xlate_dai_name(struct snd_soc_component *component,
 					struct of_phandle_args *args,
 					const char **dai_name)
 {
-	int ret = -ENOTSUPP;
-
 	if (component->driver->of_xlate_dai_name)
-		ret = component->driver->of_xlate_dai_name(component,
-							   args, dai_name);
-
-	return soc_component_ret(component, ret);
+		return component->driver->of_xlate_dai_name(component,
+							    args, dai_name);
+	/*
+	 * Don't use soc_component_ret here because we may not want to report
+	 * the error just yet. If a device has more than one component, the
+	 * first may not match and we don't want spam the log with this.
+	 */
+	return -ENOTSUPP;
 }
 
 void snd_soc_component_setup_regmap(struct snd_soc_component *component)
-- 
2.25.4


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

* Re: [PATCH] ASoC: soc-component: don't report of_xlate_dai_name failures
  2020-07-23 14:20 [PATCH] ASoC: soc-component: don't report of_xlate_dai_name failures Jerome Brunet
@ 2020-07-24 14:37 ` Mark Brown
  0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2020-07-24 14:37 UTC (permalink / raw)
  To: Liam Girdwood, Jerome Brunet; +Cc: Kuninori Morimoto, alsa-devel, linux-kernel

On Thu, 23 Jul 2020 16:20:20 +0200, Jerome Brunet wrote:
> With commit e2329eeba45f ("ASoC: soc-component: add soc_component_err()")
> every error different for ENOTSUPP or EPROBE_DEFER will log an error.
> 
> However, as explained in snd_soc_get_dai_name(), this callback may error
> to indicate that the DAI is not matched by the component tested. If the
> device provides other components, those may still match. Logging an error
> in this case is misleading.
> 
> [...]

Applied to

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

Thanks!

[1/1] ASoC: soc-component: don't report of_xlate_dai_name failures
      commit: cc4d8cebbf2a1239aab71a8077fbe20f24ec2165

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:[~2020-07-24 14:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-23 14:20 [PATCH] ASoC: soc-component: don't report of_xlate_dai_name failures Jerome Brunet
2020-07-24 14:37 ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).