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/wm9712.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/wm9712.c')
-rw-r--r-- | sound/soc/codecs/wm9712.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sound/soc/codecs/wm9712.c b/sound/soc/codecs/wm9712.c index 1b0ace0f4dca..4dc90d67530e 100644 --- a/sound/soc/codecs/wm9712.c +++ b/sound/soc/codecs/wm9712.c | |||
@@ -452,7 +452,7 @@ static unsigned int ac97_read(struct snd_soc_codec *codec, | |||
452 | else { | 452 | else { |
453 | reg = reg >> 1; | 453 | reg = reg >> 1; |
454 | 454 | ||
455 | if (reg > (ARRAY_SIZE(wm9712_reg))) | 455 | if (reg >= (ARRAY_SIZE(wm9712_reg))) |
456 | return -EIO; | 456 | return -EIO; |
457 | 457 | ||
458 | return cache[reg]; | 458 | return cache[reg]; |
@@ -466,7 +466,7 @@ static int ac97_write(struct snd_soc_codec *codec, unsigned int reg, | |||
466 | 466 | ||
467 | soc_ac97_ops.write(codec->ac97, reg, val); | 467 | soc_ac97_ops.write(codec->ac97, reg, val); |
468 | reg = reg >> 1; | 468 | reg = reg >> 1; |
469 | if (reg <= (ARRAY_SIZE(wm9712_reg))) | 469 | if (reg < (ARRAY_SIZE(wm9712_reg))) |
470 | cache[reg] = val; | 470 | cache[reg] = val; |
471 | 471 | ||
472 | return 0; | 472 | return 0; |