From: Dimitris Papastamos Date: Tue, 21 Sep 2010 16:04:07 +0000 (+0100) Subject: ASoC: Return -1 instead of -EINVAL to ensure consistency X-Git-Tag: v3.0~832^2~32^2~523 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=391d8a04fc0f0d603642daa07f379e17c88001c9;p=platform%2Fkernel%2Flinux-amlogic.git ASoC: Return -1 instead of -EINVAL to ensure consistency The code can't really cope with I/O errors, so it would be better to be consistent throughout all cache functions and return -1 instead of -EINVAL. The return value of snd_soc_read(...) is mostly checked in the probe function and nowhere else. Signed-off-by: Dimitris Papastamos Acked-by: Liam Girdwood Signed-off-by: Mark Brown --- diff --git a/sound/soc/soc-cache.c b/sound/soc/soc-cache.c index 28bf1ff..6702a3d 100644 --- a/sound/soc/soc-cache.c +++ b/sound/soc/soc-cache.c @@ -228,7 +228,7 @@ static unsigned int snd_soc_8_16_read(struct snd_soc_codec *codec, if (reg >= codec->driver->reg_cache_size || snd_soc_codec_volatile_register(codec, reg)) { if (codec->cache_only) - return -EINVAL; + return -1; return codec->hw_read(codec, reg); } else { @@ -455,7 +455,7 @@ static unsigned int snd_soc_16_16_read(struct snd_soc_codec *codec, if (reg >= codec->driver->reg_cache_size || snd_soc_codec_volatile_register(codec, reg)) { if (codec->cache_only) - return -EINVAL; + return -1; return codec->hw_read(codec, reg); }