ASoC: jack: fix snd_soc_codec_set_jack return error
authorSrinivas Kandagatla <srinivas.kandagatla@linaro.org>
Wed, 26 Jul 2017 00:35:07 +0000 (02:35 +0200)
committerMark Brown <broonie@kernel.org>
Fri, 28 Jul 2017 13:32:58 +0000 (14:32 +0100)
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>
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/soc-jack.c

index 7daf21fee355b22c0a522d51c3de723fd6b7a1fd..42ca9f19843b059a47899fca1c8fed878308eda8 100644 (file)
@@ -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);