diff mbox series

[v2] ASoC: reduce verbosity of error messages for sof-dai and sof-link

Message ID 20200529123613.13447-1-pierre-louis.bossart@linux.intel.com (mailing list archive)
State Accepted
Commit 28ff437a44fa618a14bc7402c7472b278af4c9eb
Headers show
Series [v2] ASoC: reduce verbosity of error messages for sof-dai and sof-link | expand

Commit Message

Pierre-Louis Bossart May 29, 2020, 12:36 p.m. UTC
Recent changes result in multiple dmesg traces such as:

[ 14.410435] Audio Port: ASoC: error at snd_soc_link_startup on Audio
Port: 1

[ 14.410446] sst-mfld-platform sst-mfld-platform: ASoC: error at
snd_soc_dai_startup on media-cpu-dai: 1

These messages are not really errors, when dai and dai-link callbacks
return the value of e.g. snd_pcm_hw_constraint_single() the result is
"Positive if the value is changed, zero if it's not changed, or a
negative error code"

Add a simple test to skip the checks for positive returned values

Suggested-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
---
 sound/soc/soc-dai.c  | 6 +++++-
 sound/soc/soc-link.c | 6 +++++-
 2 files changed, 10 insertions(+), 2 deletions(-)


base-commit: 4a0434502191347ba8f99468f2fb2cdddc20d381

Comments

Mark Brown May 29, 2020, 4:50 p.m. UTC | #1
On Fri, 29 May 2020 07:36:13 -0500, Pierre-Louis Bossart wrote:
> Recent changes result in multiple dmesg traces such as:
> 
> [ 14.410435] Audio Port: ASoC: error at snd_soc_link_startup on Audio
> Port: 1
> 
> [ 14.410446] sst-mfld-platform sst-mfld-platform: ASoC: error at
> snd_soc_dai_startup on media-cpu-dai: 1
> 
> [...]

Applied to

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

Thanks!

[1/1] ASoC: reduce verbosity of error messages for sof-dai and sof-link
      commit: 28ff437a44fa618a14bc7402c7472b278af4c9eb

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
diff mbox series

Patch

diff --git a/sound/soc/soc-dai.c b/sound/soc/soc-dai.c
index 2c6ac3b0afa5..b05e18b63a1c 100644
--- a/sound/soc/soc-dai.c
+++ b/sound/soc/soc-dai.c
@@ -14,10 +14,14 @@ 
 static inline int _soc_dai_ret(struct snd_soc_dai *dai,
 			       const char *func, int ret)
 {
+	/* Positive, Zero values are not errors */
+	if (ret >= 0)
+		return ret;
+
+	/* Negative values might be errors */
 	switch (ret) {
 	case -EPROBE_DEFER:
 	case -ENOTSUPP:
-	case 0:
 		break;
 	default:
 		dev_err(dai->dev,
diff --git a/sound/soc/soc-link.c b/sound/soc/soc-link.c
index 248e1be4e1eb..f849278beba0 100644
--- a/sound/soc/soc-link.c
+++ b/sound/soc/soc-link.c
@@ -12,10 +12,14 @@ 
 static inline int _soc_link_ret(struct snd_soc_pcm_runtime *rtd,
 				const char *func, int ret)
 {
+	/* Positive, Zero values are not errors */
+	if (ret >= 0)
+		return ret;
+
+	/* Negative values might be errors */
 	switch (ret) {
 	case -EPROBE_DEFER:
 	case -ENOTSUPP:
-	case 0:
 		break;
 	default:
 		dev_err(rtd->dev,