ASoC: jack: fix snd_soc_codec_set_jack return error

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>
This commit is contained in:
Srinivas Kandagatla 2017-07-26 02:35:07 +02:00 committed by Mark Brown
parent 5771a8c088
commit 77a4525bc2

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