diff options
author | Axel Lin <axel.lin@gmail.com> | 2011-11-22 23:46:11 -0500 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2011-11-23 06:34:21 -0500 |
commit | b284362b6b45150d171ff5bed92bc416b040aead (patch) | |
tree | ff4acd003d7aa8113db19c9deb645f4bb6233392 /sound | |
parent | 4ca8af579c9748376db537575f7a811c179fe50a (diff) |
ASoC: cs42l51: Fix off-by-one for reg_cache_size
Just checking the code in cs42l51_fill_cache():
The cache pointer points to codec->reg_cache + 1.
I think it is because CS42L51_FIRSTREG is 0x01,
so codec->reg_cache[0] is not used here.
Then we read CS42L51_NUMREGS bytes to cache.
So we need reg_cache_size to be CS42L51_NUMREGS + 1.
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/soc/codecs/cs42l51.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sound/soc/codecs/cs42l51.c b/sound/soc/codecs/cs42l51.c index 8c3c8205d19e..1ee66361f61b 100644 --- a/sound/soc/codecs/cs42l51.c +++ b/sound/soc/codecs/cs42l51.c | |||
@@ -555,7 +555,7 @@ static int cs42l51_probe(struct snd_soc_codec *codec) | |||
555 | 555 | ||
556 | static struct snd_soc_codec_driver soc_codec_device_cs42l51 = { | 556 | static struct snd_soc_codec_driver soc_codec_device_cs42l51 = { |
557 | .probe = cs42l51_probe, | 557 | .probe = cs42l51_probe, |
558 | .reg_cache_size = CS42L51_NUMREGS, | 558 | .reg_cache_size = CS42L51_NUMREGS + 1, |
559 | .reg_word_size = sizeof(u8), | 559 | .reg_word_size = sizeof(u8), |
560 | }; | 560 | }; |
561 | 561 | ||