提交 391d8a04 编写于 作者: D Dimitris Papastamos 提交者: Mark Brown

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: NDimitris Papastamos <dp@opensource.wolfsonmicro.com>
Acked-by: NLiam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
上级 321de0d0
......@@ -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);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册