diff options
Diffstat (limited to 'sound/soc/au1x')
-rw-r--r-- | sound/soc/au1x/dbdma2.c | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/sound/soc/au1x/dbdma2.c b/sound/soc/au1x/dbdma2.c index 92bc1b0346fa..8372cd35f0d6 100644 --- a/sound/soc/au1x/dbdma2.c +++ b/sound/soc/au1x/dbdma2.c | |||
@@ -350,27 +350,21 @@ static struct snd_soc_platform_driver au1xpsc_soc_platform = { | |||
350 | static int __devinit au1xpsc_pcm_drvprobe(struct platform_device *pdev) | 350 | static int __devinit au1xpsc_pcm_drvprobe(struct platform_device *pdev) |
351 | { | 351 | { |
352 | struct au1xpsc_audio_dmadata *dmadata; | 352 | struct au1xpsc_audio_dmadata *dmadata; |
353 | int ret; | ||
354 | 353 | ||
355 | dmadata = kzalloc(2 * sizeof(struct au1xpsc_audio_dmadata), GFP_KERNEL); | 354 | dmadata = devm_kzalloc(&pdev->dev, |
355 | 2 * sizeof(struct au1xpsc_audio_dmadata), | ||
356 | GFP_KERNEL); | ||
356 | if (!dmadata) | 357 | if (!dmadata) |
357 | return -ENOMEM; | 358 | return -ENOMEM; |
358 | 359 | ||
359 | platform_set_drvdata(pdev, dmadata); | 360 | platform_set_drvdata(pdev, dmadata); |
360 | 361 | ||
361 | ret = snd_soc_register_platform(&pdev->dev, &au1xpsc_soc_platform); | 362 | return snd_soc_register_platform(&pdev->dev, &au1xpsc_soc_platform); |
362 | if (ret) | ||
363 | kfree(dmadata); | ||
364 | |||
365 | return ret; | ||
366 | } | 363 | } |
367 | 364 | ||
368 | static int __devexit au1xpsc_pcm_drvremove(struct platform_device *pdev) | 365 | static int __devexit au1xpsc_pcm_drvremove(struct platform_device *pdev) |
369 | { | 366 | { |
370 | struct au1xpsc_audio_dmadata *dmadata = platform_get_drvdata(pdev); | ||
371 | |||
372 | snd_soc_unregister_platform(&pdev->dev); | 367 | snd_soc_unregister_platform(&pdev->dev); |
373 | kfree(dmadata); | ||
374 | 368 | ||
375 | return 0; | 369 | return 0; |
376 | } | 370 | } |