diff options
author | Graeme Gregory <gg@opensource.wolfsonmicro.com> | 2007-04-16 15:35:46 +0200 |
---|---|---|
committer | Jaroslav Kysela <perex@suse.cz> | 2007-05-11 16:56:00 +0200 |
commit | 30652c4506c8bbfdf869ddc4c238e07de038f02a (patch) | |
tree | 4af44ac9e798d56b9455df07a34f5a4eee3e37dd /sound/soc | |
parent | 826220463f619d14c5efea51aac6277b441052b8 (diff) | |
download | kernel_samsung_smdk4412-30652c4506c8bbfdf869ddc4c238e07de038f02a.zip kernel_samsung_smdk4412-30652c4506c8bbfdf869ddc4c238e07de038f02a.tar.gz kernel_samsung_smdk4412-30652c4506c8bbfdf869ddc4c238e07de038f02a.tar.bz2 |
[ALSA] ASoC WM9712 kmemdup
This patch creates the WM9712 codec register cache using kmemdup instead
of doing a kzalloc followed by a memcpy.
Signed-off-by: Graeme Gregory <gg@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lg@opensource.wolfsonmicro.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@suse.cz>
Diffstat (limited to 'sound/soc')
-rw-r--r-- | sound/soc/codecs/wm9712.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/sound/soc/codecs/wm9712.c b/sound/soc/codecs/wm9712.c index ee7a691..264413a 100644 --- a/sound/soc/codecs/wm9712.c +++ b/sound/soc/codecs/wm9712.c @@ -676,14 +676,13 @@ static int wm9712_soc_probe(struct platform_device *pdev) codec = socdev->codec; mutex_init(&codec->mutex); - codec->reg_cache = - kzalloc(sizeof(u16) * ARRAY_SIZE(wm9712_reg), GFP_KERNEL); + codec->reg_cache = kmemdup(wm9712_reg, sizeof(wm9712_reg), GFP_KERNEL); + if (codec->reg_cache == NULL) { ret = -ENOMEM; goto cache_err; } - memcpy(codec->reg_cache, wm9712_reg, sizeof(u16) * ARRAY_SIZE(wm9712_reg)); - codec->reg_cache_size = sizeof(u16) * ARRAY_SIZE(wm9712_reg); + codec->reg_cache_size = sizeof(wm9712_reg); codec->reg_cache_step = 2; codec->name = "WM9712"; |