浏览代码

ALSA: ASoC: Fix register cache sizes for Wolfson codecs

The register cache size is used by the codec_reg sysfs file which works in
terms of the register cache access functions rather than in terms of raw
access to the cache so the size specified needs to be in terms of the
number of elements.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Mark Brown 17 年之前
父节点
当前提交
d751b233bb
共有 3 个文件被更改,包括 3 次插入3 次删除
  1. 1 1
      sound/soc/codecs/wm8731.c
  2. 1 1
      sound/soc/codecs/wm8750.c
  3. 1 1
      sound/soc/codecs/wm8753.c

+ 1 - 1
sound/soc/codecs/wm8731.c

@@ -534,7 +534,7 @@ static int wm8731_init(struct snd_soc_device *socdev)
 	codec->set_bias_level = wm8731_set_bias_level;
 	codec->set_bias_level = wm8731_set_bias_level;
 	codec->dai = &wm8731_dai;
 	codec->dai = &wm8731_dai;
 	codec->num_dai = 1;
 	codec->num_dai = 1;
-	codec->reg_cache_size = sizeof(wm8731_reg);
+	codec->reg_cache_size = ARRAY_SIZE(wm8731_reg);
 	codec->reg_cache = kmemdup(wm8731_reg, sizeof(wm8731_reg), GFP_KERNEL);
 	codec->reg_cache = kmemdup(wm8731_reg, sizeof(wm8731_reg), GFP_KERNEL);
 	if (codec->reg_cache == NULL)
 	if (codec->reg_cache == NULL)
 		return -ENOMEM;
 		return -ENOMEM;

+ 1 - 1
sound/soc/codecs/wm8750.c

@@ -798,7 +798,7 @@ static int wm8750_init(struct snd_soc_device *socdev)
 	codec->set_bias_level = wm8750_set_bias_level;
 	codec->set_bias_level = wm8750_set_bias_level;
 	codec->dai = &wm8750_dai;
 	codec->dai = &wm8750_dai;
 	codec->num_dai = 1;
 	codec->num_dai = 1;
-	codec->reg_cache_size = sizeof(wm8750_reg);
+	codec->reg_cache_size = ARRAY_SIZE(wm8750_reg);
 	codec->reg_cache = kmemdup(wm8750_reg, sizeof(wm8750_reg), GFP_KERNEL);
 	codec->reg_cache = kmemdup(wm8750_reg, sizeof(wm8750_reg), GFP_KERNEL);
 	if (codec->reg_cache == NULL)
 	if (codec->reg_cache == NULL)
 		return -ENOMEM;
 		return -ENOMEM;

+ 1 - 1
sound/soc/codecs/wm8753.c

@@ -1557,7 +1557,7 @@ static int wm8753_init(struct snd_soc_device *socdev)
 	codec->set_bias_level = wm8753_set_bias_level;
 	codec->set_bias_level = wm8753_set_bias_level;
 	codec->dai = wm8753_dai;
 	codec->dai = wm8753_dai;
 	codec->num_dai = 2;
 	codec->num_dai = 2;
-	codec->reg_cache_size = sizeof(wm8753_reg);
+	codec->reg_cache_size = ARRAY_SIZE(wm8753_reg);
 	codec->reg_cache = kmemdup(wm8753_reg, sizeof(wm8753_reg), GFP_KERNEL);
 	codec->reg_cache = kmemdup(wm8753_reg, sizeof(wm8753_reg), GFP_KERNEL);
 
 
 	if (codec->reg_cache == NULL)
 	if (codec->reg_cache == NULL)