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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Pierre-Louis

> 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 only log errors when the result is
> negative.
> 
> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@xxxxxxxxxxxxxxx>
> ---

Thank you for pointing it.
Some functions which has above rule isn't use soc_xxx_ret() actually.
Anyway, more simply, how about this ?

----------
diff --git a/sound/soc/soc-dai.c b/sound/soc/soc-dai.c
index ae8b2c93cb66..da83059faf4e 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 are not error */
+	if (ret >= 0)
+		return ret;
+
+	/* Negative might be error */
 	switch (ret) {
 	case -EPROBE_DEFER:
 	case -ENOTSUPP:
-	case 0:
 		break;
 	default:
 		dev_err(dai->dev,
----------

Thank you for your help !!

Best regards
---
Kuninori Morimoto



[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Pulse Audio]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux