Skip to contentSkip to conversation

ASoC: Fix reg_cache_size for stac9766

PATCH Applied Axel Lin 2 participants 4 messages Dec 5, 2011

Subsystems (2)
lore
Share & tools
lore

Axel Lin

author
#0 lore raw

PATCH 1/1 ASoC: Fix reg_cache_size for stac9766

reg_cache_size is supposed to be the number of elements in the register cache, not the size in bytes.

---
 sound/soc/codecs/stac9766.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
sound/soc/codecs/stac9766.c +1 -1
index 5581953..da71615 100644
@@ -380,7 +380,7 @@ static struct snd_soc_codec_driver soc_codec_dev_stac9766 = {
 	.remove = stac9766_codec_remove,
 	.suspend = stac9766_codec_suspend,
 	.resume = stac9766_codec_resume,
-	.reg_cache_size = sizeof(stac9766_reg),
+	.reg_cache_size = ARRAY_SIZE(stac9766_reg),
 	.reg_word_size = sizeof(u16),
 	.reg_cache_step = 2,
 	.reg_cache_default = stac9766_reg,
Signature · 1 line
1.7.5.4
Applied
#1 lore raw
Quoted 2 lines · Axel Lin

reg_cache_size is supposed to be the number of elements in the register cache, not the size in bytes.

Applied, though note that in this case as the register values are 8 bits the two numbers are exactly the same so this is a coding style fix only (but still useful!).

author
#2 lore raw

2011/12/5 Mark Brown <[email protected]>:

Quoted 7 lines · Axel Lin
Quoted 2 lines

reg_cache_size is supposed to be the number of elements in the register cache, not the size in bytes.

Applied, though note that in this case as the register values are 8 bits the two numbers are exactly the same so this is a coding style fix only (but still useful!).

Actually, the register values are 16 bits.
static const u16 stac9766_reg[] = {

Axel

#3 lore raw
Quoted 2 lines · Axel Lin

Actually, the register values are 16 bits.
static const u16 stac9766_reg[] = {

Oh dear, looked at the wrong sta... driver, sorry.