diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2009-01-23 17:55:23 -0500 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2009-01-27 05:30:54 -0500 |
commit | 6627a653bceb3a54e55e5cdc478ec5b8d5c9cc44 (patch) | |
tree | 9a6f157ad1123e4f047689bbf3c4ef88ec1259a4 /sound/soc/codecs/wm9705.c | |
parent | 0db4d0705260dd4bddf1e5a5441c58bdf08bdc9f (diff) |
ASoC: Push the codec runtime storage into the card structure
This is a further stage on the road to refactoring away the ASoC
platform device.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/codecs/wm9705.c')
-rw-r--r-- | sound/soc/codecs/wm9705.c | 15 |
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: | |||
380 | codec_err: | 381 | codec_err: |
381 | kfree(codec->reg_cache); | 382 | kfree(codec->reg_cache); |
382 | cache_err: | 383 | cache_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 | ||
388 | static int wm9705_soc_remove(struct platform_device *pdev) | 389 | static 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; |