From: Pierre-Louis Bossart Date: Fri, 29 May 2020 12:36:13 +0000 (-0500) Subject: ASoC: reduce verbosity of error messages for sof-dai and sof-link X-Git-Tag: v5.15~2585^2~131^2~35 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=28ff437a44fa618a14bc7402c7472b278af4c9eb;p=platform%2Fkernel%2Flinux-starfive.git ASoC: reduce verbosity of error messages for sof-dai and sof-link 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 Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20200529123613.13447-1-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown --- diff --git a/sound/soc/soc-dai.c b/sound/soc/soc-dai.c index 2c6ac3b..b05e18b 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 248e1be..f849278 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,