]> err.no Git - linux-2.6/commitdiff
ALSA: ASoC: Fix register cache sizes for Wolfson codecs
authorMark Brown <broonie@opensource.wolfsonmicro.com>
Wed, 11 Jun 2008 12:47:06 +0000 (13:47 +0100)
committerJaroslav Kysela <perex@perex.cz>
Fri, 13 Jun 2008 14:47:42 +0000 (16:47 +0200)
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>
sound/soc/codecs/wm8731.c
sound/soc/codecs/wm8750.c
sound/soc/codecs/wm8753.c

index 5acf43ab104eb94c7733d554147668a00c7213ec..77880537a3cda1dfa34407ef10171a31bb4a36c8 100644 (file)
@@ -534,7 +534,7 @@ static int wm8731_init(struct snd_soc_device *socdev)
        codec->set_bias_level = wm8731_set_bias_level;
        codec->dai = &wm8731_dai;
        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);
        if (codec->reg_cache == NULL)
                return -ENOMEM;
index 1f11ad24551ad99b834bf40b332437731ed8ae9d..1ae670a98c5c564cdd3061c8986aaf49f1d94b45 100644 (file)
@@ -798,7 +798,7 @@ static int wm8750_init(struct snd_soc_device *socdev)
        codec->set_bias_level = wm8750_set_bias_level;
        codec->dai = &wm8750_dai;
        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);
        if (codec->reg_cache == NULL)
                return -ENOMEM;
index c32e6326be6cd972d6ab79a81fbfed86b66e56f5..285c5eaefe0223ddb228696b435fef5e88bc859e 100644 (file)
@@ -1557,7 +1557,7 @@ static int wm8753_init(struct snd_soc_device *socdev)
        codec->set_bias_level = wm8753_set_bias_level;
        codec->dai = wm8753_dai;
        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);
 
        if (codec->reg_cache == NULL)