summaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/twl4030.c
diff options
context:
space:
mode:
authorIan Molton2009-01-17 18:44:23 +0100
committerMark Brown2009-01-19 17:23:13 +0100
commit91432e976ff1323e5dd6f52498969602953c6ee9 (patch)
treee18da7346b857e384a78ecc3368e5c65652ef1b5 /sound/soc/codecs/twl4030.c
parentASoC: machine support for Toshiba e740 PDA (diff)
downloadkernel-qcow2-linux-91432e976ff1323e5dd6f52498969602953c6ee9.tar.gz
kernel-qcow2-linux-91432e976ff1323e5dd6f52498969602953c6ee9.tar.xz
kernel-qcow2-linux-91432e976ff1323e5dd6f52498969602953c6ee9.zip
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.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/sound/soc/codecs/twl4030.c b/sound/soc/codecs/twl4030.c
index ddc9f37d863f..f530c1e6d9e8 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];
}