aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/mid-x86
diff options
context:
space:
mode:
authorVinod Koul <vinod.koul@intel.com>2011-02-15 07:58:55 -0500
committerMark Brown <broonie@opensource.wolfsonmicro.com>2011-02-15 20:59:05 -0500
commitd58198b943c7af6975dec869d75b15dd66d1495c (patch)
tree8c4ea045c7b2a309eb4b00203afdf2a4a64168bd /sound/soc/mid-x86
parent65e9625e1f86658ee869420713be3afb9a75debd (diff)
ASoC: mfld_machine: make use of soc_register_card API
This patch removes the old method of soc-audio device creation in mfld machine and makes use of new soc_register_card API to register the card Signed-off-by: Vinod Koul <vinod.koul@intel.com> Signed-off-by: Harsha Priya <priya.harsha@intel.com> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/mid-x86')
-rw-r--r--sound/soc/mid-x86/mfld_machine.c20
1 files changed, 6 insertions, 14 deletions
diff --git a/sound/soc/mid-x86/mfld_machine.c b/sound/soc/mid-x86/mfld_machine.c
index 96487fb8d265..429aa1be2cff 100644
--- a/sound/soc/mid-x86/mfld_machine.c
+++ b/sound/soc/mid-x86/mfld_machine.c
@@ -392,25 +392,17 @@ static int __devinit snd_mfld_mc_probe(struct platform_device *pdev)
392 pr_err("cannot register IRQ\n"); 392 pr_err("cannot register IRQ\n");
393 goto unalloc; 393 goto unalloc;
394 } 394 }
395 /* create soc device */ 395 /* register the soc card */
396 mc_drv_ctx->socdev = platform_device_alloc("soc-audio", -1); 396 snd_soc_card_mfld.dev = &pdev->dev;
397 if (!mc_drv_ctx->socdev) { 397 ret_val = snd_soc_register_card(&snd_soc_card_mfld);
398 pr_err("soc-audio device allocation failed\n");
399 ret_val = -ENOMEM;
400 goto freeirq;
401 }
402 platform_set_drvdata(mc_drv_ctx->socdev, &snd_soc_card_mfld);
403 ret_val = platform_device_add(mc_drv_ctx->socdev);
404 if (ret_val) { 398 if (ret_val) {
405 pr_err("Unable to add soc-audio device, err %d\n", ret_val); 399 pr_debug("snd_soc_register_card failed %d\n", ret_val);
406 goto unregister; 400 goto freeirq;
407 } 401 }
408 platform_set_drvdata(pdev, mc_drv_ctx); 402 platform_set_drvdata(pdev, mc_drv_ctx);
409 pr_debug("successfully exited probe\n"); 403 pr_debug("successfully exited probe\n");
410 return ret_val; 404 return ret_val;
411 405
412unregister:
413 platform_device_put(mc_drv_ctx->socdev);
414freeirq: 406freeirq:
415 free_irq(irq, mc_drv_ctx); 407 free_irq(irq, mc_drv_ctx);
416unalloc: 408unalloc:
@@ -424,7 +416,7 @@ static int __devexit snd_mfld_mc_remove(struct platform_device *pdev)
424 416
425 pr_debug("snd_mfld_mc_remove called\n"); 417 pr_debug("snd_mfld_mc_remove called\n");
426 free_irq(platform_get_irq(pdev, 0), mc_drv_ctx); 418 free_irq(platform_get_irq(pdev, 0), mc_drv_ctx);
427 platform_device_unregister(mc_drv_ctx->socdev); 419 snd_soc_unregister_card(&snd_soc_card_mfld);
428 kfree(mc_drv_ctx); 420 kfree(mc_drv_ctx);
429 platform_set_drvdata(pdev, NULL); 421 platform_set_drvdata(pdev, NULL);
430 return 0; 422 return 0;