diff options
author | Ian Molton <ian@mnementh.co.uk> | 2009-01-17 12:44:23 -0500 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2009-01-19 11:23:13 -0500 |
commit | 91432e976ff1323e5dd6f52498969602953c6ee9 (patch) | |
tree | e18da7346b857e384a78ecc3368e5c65652ef1b5 /sound/soc/codecs/wm9713.c | |
parent | 28796eaf806502b9bd86cbacf8edbc14c80c14b0 (diff) |
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/wm9713.c')
-rw-r--r-- | sound/soc/codecs/wm9713.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sound/soc/codecs/wm9713.c b/sound/soc/codecs/wm9713.c index e636d8a18ed6..0e60e16973d4 100644 --- a/sound/soc/codecs/wm9713.c +++ b/sound/soc/codecs/wm9713.c | |||
@@ -620,7 +620,7 @@ static unsigned int ac97_read(struct snd_soc_codec *codec, | |||
620 | else { | 620 | else { |
621 | reg = reg >> 1; | 621 | reg = reg >> 1; |
622 | 622 | ||
623 | if (reg > (ARRAY_SIZE(wm9713_reg))) | 623 | if (reg >= (ARRAY_SIZE(wm9713_reg))) |
624 | return -EIO; | 624 | return -EIO; |
625 | 625 | ||
626 | return cache[reg]; | 626 | return cache[reg]; |
@@ -634,7 +634,7 @@ static int ac97_write(struct snd_soc_codec *codec, unsigned int reg, | |||
634 | if (reg < 0x7c) | 634 | if (reg < 0x7c) |
635 | soc_ac97_ops.write(codec->ac97, reg, val); | 635 | soc_ac97_ops.write(codec->ac97, reg, val); |
636 | reg = reg >> 1; | 636 | reg = reg >> 1; |
637 | if (reg <= (ARRAY_SIZE(wm9713_reg))) | 637 | if (reg < (ARRAY_SIZE(wm9713_reg))) |
638 | cache[reg] = val; | 638 | cache[reg] = val; |
639 | 639 | ||
640 | return 0; | 640 | return 0; |