diff options
author | Ian Molton <ian@mnementh.co.uk> | 2009-01-17 17:44:23 +0000 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2009-01-19 16:23:13 +0000 |
commit | 91432e976ff1323e5dd6f52498969602953c6ee9 (patch) | |
tree | e18da7346b857e384a78ecc3368e5c65652ef1b5 /sound/soc/codecs/twl4030.c | |
parent | 28796eaf806502b9bd86cbacf8edbc14c80c14b0 (diff) | |
download | op-kernel-dev-91432e976ff1323e5dd6f52498969602953c6ee9.zip op-kernel-dev-91432e976ff1323e5dd6f52498969602953c6ee9.tar.gz |
ASoC: fixes to caching implementations
This patch takes fixes a number of bugs in the caching code used by
several ASoC codec drivers. Mostly off-by-one fixes.
Signed-off-by: Ian Molton <ian@mnementh.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/codecs/twl4030.c')
-rw-r--r-- | sound/soc/codecs/twl4030.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/sound/soc/codecs/twl4030.c b/sound/soc/codecs/twl4030.c index ddc9f37..f530c1e 100644 --- a/sound/soc/codecs/twl4030.c +++ b/sound/soc/codecs/twl4030.c @@ -125,6 +125,9 @@ static inline unsigned int twl4030_read_reg_cache(struct snd_soc_codec *codec, { u8 *cache = codec->reg_cache; + if (reg >= TWL4030_CACHEREGNUM) + return -EIO; + return cache[reg]; } |