Browse Source

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>
Srinivas Kandagatla 8 years ago
parent
commit
77a4525bc2
1 changed files with 1 additions and 1 deletions
  1. 1 1
      sound/soc/soc-jack.c

+ 1 - 1
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)
 	if (codec->driver->set_jack)
 		return codec->driver->set_jack(codec, jack, data);
 		return codec->driver->set_jack(codec, jack, data);
 	else
 	else
-		return -EINVAL;
+		return -ENOTSUPP;
 }
 }
 EXPORT_SYMBOL_GPL(snd_soc_codec_set_jack);
 EXPORT_SYMBOL_GPL(snd_soc_codec_set_jack);