[PATCH] ASoC: soc-pcm: don't ignore -EINVAL on soc_pcm_ret()

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



commit 1f5664351410 ("ASoC: lower "no backend DAIs enabled for ... Port"
log severity") ignores -EINVAL error message on common soc_pcm_ret().
It is used from many functions, ignoring -EINVAL is not good idea.

The reason why -EINVAL was ignored is only for ignoring
dpcm_fe_dai_prepare() error flood.
It should be handled at dpcm_fe_dai_prepare() side, not soc_pcm_ret()
side.

Cc: Hans de Goede <hdegoede@xxxxxxxxxx>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@xxxxxxxxxxx>
---
 sound/soc/soc-pcm.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c
index 1150455619aa4..7ea580f0a6f7f 100644
--- a/sound/soc/soc-pcm.c
+++ b/sound/soc/soc-pcm.c
@@ -38,7 +38,6 @@ static inline int _soc_pcm_ret(struct snd_soc_pcm_runtime *rtd,
 	switch (ret) {
 	case -EPROBE_DEFER:
 	case -ENOTSUPP:
-	case -EINVAL:
 		break;
 	default:
 		dev_err(rtd->dev,
@@ -2560,8 +2559,8 @@ static int dpcm_fe_dai_prepare(struct snd_pcm_substream *substream)
 			     fe->dai_link->name);
 		dev_dbg(fe->dev, "ASoC: no backend DAIs enabled for %s\n",
 			fe->dai_link->name);
-		ret = -EINVAL;
-		goto out;
+		/* don't use soc_pcm_ret() to lower error log severity */
+		return -EINVAL;
 	}
 
 	ret = dpcm_be_dai_prepare(fe, stream);
-- 
2.43.0





[Index of Archives]     [Pulseaudio]     [Linux Audio Users]     [ALSA Devel]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]

  Powered by Linux