diff mbox

[v1,1/6] ASoC: jack: fix snd_soc_codec_set_jack return error

Message ID 20170726003512.18965-2-srinivas.kandagatla@linaro.org (mailing list archive)
State Accepted
Commit 77a4525bc282b7072ebda5d6f6925ca6d604a16f
Headers show

Commit Message

Srinivas Kandagatla July 26, 2017, 12:35 a.m. UTC
From: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>

This patch changes the error code returned by snd_soc_codec_set_jack()
from -EINVAL to -ENOTSUPP. The reason to do this is to make the caller
aware that the underlying codec does not support this callback. This can
make the caller write the code to handle this case properly.
Other reason is that -EINVAL is not the correct error to return in this
case anyway.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
---
 sound/soc/soc-jack.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox

Patch

diff --git a/sound/soc/soc-jack.c b/sound/soc/soc-jack.c
index 7daf21f..42ca9f1 100644
--- a/sound/soc/soc-jack.c
+++ b/sound/soc/soc-jack.c
@@ -36,7 +36,7 @@  int snd_soc_codec_set_jack(struct snd_soc_codec *codec,
 	if (codec->driver->set_jack)
 		return codec->driver->set_jack(codec, jack, data);
 	else
-		return -EINVAL;
+		return -ENOTSUPP;
 }
 EXPORT_SYMBOL_GPL(snd_soc_codec_set_jack);