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>
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 {
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);
}