diff options
| author | Dimitris Papastamos <dp@opensource.wolfsonmicro.com> | 2010-09-21 12:04:07 -0400 |
|---|---|---|
| committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2010-09-22 11:48:50 -0400 |
| commit | 391d8a04fc0f0d603642daa07f379e17c88001c9 (patch) | |
| tree | 041b6bd448ada9513b8b7f8e9facaee4d07a5110 | |
| parent | 321de0d05a4bbe0ee74d473e00d7947851bf5284 (diff) | |
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 <dp@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
| -rw-r--r-- | sound/soc/soc-cache.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sound/soc/soc-cache.c b/sound/soc/soc-cache.c index 28bf1ff980ce..6702a3dcd3fe 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, | |||
| 228 | if (reg >= codec->driver->reg_cache_size || | 228 | if (reg >= codec->driver->reg_cache_size || |
| 229 | snd_soc_codec_volatile_register(codec, reg)) { | 229 | snd_soc_codec_volatile_register(codec, reg)) { |
| 230 | if (codec->cache_only) | 230 | if (codec->cache_only) |
| 231 | return -EINVAL; | 231 | return -1; |
| 232 | 232 | ||
| 233 | return codec->hw_read(codec, reg); | 233 | return codec->hw_read(codec, reg); |
| 234 | } else { | 234 | } else { |
| @@ -455,7 +455,7 @@ static unsigned int snd_soc_16_16_read(struct snd_soc_codec *codec, | |||
| 455 | if (reg >= codec->driver->reg_cache_size || | 455 | if (reg >= codec->driver->reg_cache_size || |
| 456 | snd_soc_codec_volatile_register(codec, reg)) { | 456 | snd_soc_codec_volatile_register(codec, reg)) { |
| 457 | if (codec->cache_only) | 457 | if (codec->cache_only) |
| 458 | return -EINVAL; | 458 | return -1; |
| 459 | 459 | ||
| 460 | return codec->hw_read(codec, reg); | 460 | return codec->hw_read(codec, reg); |
| 461 | } | 461 | } |
