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>
This commit is contained in:
@@ -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];
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user