aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/wm9705.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/codecs/wm9705.c')
-rw-r--r--sound/soc/codecs/wm9705.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/sound/soc/codecs/wm9705.c b/sound/soc/codecs/wm9705.c
index d5c81bb3decb..2e9e06b2daaf 100644
--- a/sound/soc/codecs/wm9705.c
+++ b/sound/soc/codecs/wm9705.c
@@ -249,7 +249,7 @@ static int ac97_prepare(struct snd_pcm_substream *substream,
249 struct snd_pcm_runtime *runtime = substream->runtime; 249 struct snd_pcm_runtime *runtime = substream->runtime;
250 struct snd_soc_pcm_runtime *rtd = substream->private_data; 250 struct snd_soc_pcm_runtime *rtd = substream->private_data;
251 struct snd_soc_device *socdev = rtd->socdev; 251 struct snd_soc_device *socdev = rtd->socdev;
252 struct snd_soc_codec *codec = socdev->codec; 252 struct snd_soc_codec *codec = socdev->card->codec;
253 int reg; 253 int reg;
254 u16 vra; 254 u16 vra;
255 255
@@ -323,10 +323,11 @@ static int wm9705_soc_probe(struct platform_device *pdev)
323 323
324 printk(KERN_INFO "WM9705 SoC Audio Codec\n"); 324 printk(KERN_INFO "WM9705 SoC Audio Codec\n");
325 325
326 socdev->codec = kzalloc(sizeof(struct snd_soc_codec), GFP_KERNEL); 326 socdev->card->codec = kzalloc(sizeof(struct snd_soc_codec),
327 if (socdev->codec == NULL) 327 GFP_KERNEL);
328 if (socdev->card->codec == NULL)
328 return -ENOMEM; 329 return -ENOMEM;
329 codec = socdev->codec; 330 codec = socdev->card->codec;
330 mutex_init(&codec->mutex); 331 mutex_init(&codec->mutex);
331 332
332 codec->reg_cache = kmemdup(wm9705_reg, sizeof(wm9705_reg), GFP_KERNEL); 333 codec->reg_cache = kmemdup(wm9705_reg, sizeof(wm9705_reg), GFP_KERNEL);
@@ -380,15 +381,15 @@ pcm_err:
380codec_err: 381codec_err:
381 kfree(codec->reg_cache); 382 kfree(codec->reg_cache);
382cache_err: 383cache_err:
383 kfree(socdev->codec); 384 kfree(socdev->card->codec);
384 socdev->codec = NULL; 385 socdev->card->codec = NULL;
385 return ret; 386 return ret;
386} 387}
387 388
388static int wm9705_soc_remove(struct platform_device *pdev) 389static int wm9705_soc_remove(struct platform_device *pdev)
389{ 390{
390 struct snd_soc_device *socdev = platform_get_drvdata(pdev); 391 struct snd_soc_device *socdev = platform_get_drvdata(pdev);
391 struct snd_soc_codec *codec = socdev->codec; 392 struct snd_soc_codec *codec = socdev->card->codec;
392 393
393 if (codec == NULL) 394 if (codec == NULL)
394 return 0; 395 return 0;