Skip to content

Commit b284362

Browse files
AxelLinbroonie
authored andcommitted
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>
1 parent 4ca8af5 commit b284362

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎sound/soc/codecs/cs42l51.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -555,7 +555,7 @@ static int cs42l51_probe(struct snd_soc_codec *codec)
555555

556556
static struct snd_soc_codec_driver soc_codec_device_cs42l51 = {
557557
.probe = cs42l51_probe,
558-
.reg_cache_size = CS42L51_NUMREGS,
558+
.reg_cache_size = CS42L51_NUMREGS + 1,
559559
.reg_word_size = sizeof(u8),
560560
};
561561

0 commit comments

Comments
 (0)