Commit 28ff437a authored by Pierre-Louis Bossart's avatar Pierre-Louis Bossart Committed by Mark Brown

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: default avatarKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: default avatarPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200529123613.13447-1-pierre-louis.bossart@linux.intel.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 67866ff9
...@@ -14,10 +14,14 @@ ...@@ -14,10 +14,14 @@
static inline int _soc_dai_ret(struct snd_soc_dai *dai, static inline int _soc_dai_ret(struct snd_soc_dai *dai,
const char *func, int ret) const char *func, int ret)
{ {
/* Positive, Zero values are not errors */
if (ret >= 0)
return ret;
/* Negative values might be errors */
switch (ret) { switch (ret) {
case -EPROBE_DEFER: case -EPROBE_DEFER:
case -ENOTSUPP: case -ENOTSUPP:
case 0:
break; break;
default: default:
dev_err(dai->dev, dev_err(dai->dev,
......
...@@ -12,10 +12,14 @@ ...@@ -12,10 +12,14 @@
static inline int _soc_link_ret(struct snd_soc_pcm_runtime *rtd, static inline int _soc_link_ret(struct snd_soc_pcm_runtime *rtd,
const char *func, int ret) const char *func, int ret)
{ {
/* Positive, Zero values are not errors */
if (ret >= 0)
return ret;
/* Negative values might be errors */
switch (ret) { switch (ret) {
case -EPROBE_DEFER: case -EPROBE_DEFER:
case -ENOTSUPP: case -ENOTSUPP:
case 0:
break; break;
default: default:
dev_err(rtd->dev, dev_err(rtd->dev,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment