]> git.baikalelectronics.ru Git - kernel.git/commit
ASoC: cs42l51: Fix off-by-one for reg_cache_size
authorAxel Lin <axel.lin@gmail.com>
Wed, 23 Nov 2011 04:46:11 +0000 (12:46 +0800)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Wed, 23 Nov 2011 11:34:21 +0000 (11:34 +0000)
commitb7297e49f51aa3860ba47b621e608f62e5d1c981
treeff4acd003d7aa8113db19c9deb645f4bb6233392
parent852a041b5dd14dbe7e820528e1e7110f4e65b4cf
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>
sound/soc/codecs/cs42l51.c