Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1702299

[PATCH v2 1/6] ASoC: jack: fix snd_soc_codec_set_jack return error

From srinivas.kandagatla@linaro.org
Newsgroups linux.kernel
Subject [PATCH v2 1/6] ASoC: jack: fix snd_soc_codec_set_jack return error
Date 2017-08-02 19:20 +0200
Message-ID <ua5tp-4lS-39@gated-at.bofh.it> (permalink)
References <ua5to-4lS-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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 --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);
 
-- 
2.9.3

Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v2 0/6] ASoC: codecs: msm8916-wcd-analog: Add support to MBHC srinivas.kandagatla@linaro.org - 2017-08-02 19:20 +0200
  [PATCH v2 1/6] ASoC: jack: fix snd_soc_codec_set_jack return error srinivas.kandagatla@linaro.org - 2017-08-02 19:20 +0200
  [PATCH v2 6/6] arm64: dts: apq8016-sbc: add mbhc buttons support srinivas.kandagatla@linaro.org - 2017-08-02 19:20 +0200
  [PATCH v2 3/6] ASoC: codecs: msm8916-wcd-analog: get micbias voltage from dt srinivas.kandagatla@linaro.org - 2017-08-02 19:20 +0200
  [PATCH v2 2/6] ASoC: codecs: msm8916-wcd-analog: move codec reset to probe srinivas.kandagatla@linaro.org - 2017-08-02 19:20 +0200

csiph-web