From: Srinivas Kandagatla Date: Wed, 26 Jul 2017 00:35:07 +0000 (+0200) Subject: ASoC: jack: fix snd_soc_codec_set_jack return error X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=77a4525bc282b7072ebda5d6f6925ca6d604a16f;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git 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 Signed-off-by: Mark Brown --- diff --git a/sound/soc/soc-jack.c b/sound/soc/soc-jack.c index 7daf21fee355..42ca9f19843b 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);