From d58198b943c7af6975dec869d75b15dd66d1495c Mon Sep 17 00:00:00 2001 From: Vinod Koul Date: Tue, 15 Feb 2011 18:28:55 +0530 Subject: [PATCH] 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 Signed-off-by: Harsha Priya Acked-by: Liam Girdwood Signed-off-by: Mark Brown --- sound/soc/mid-x86/mfld_machine.c | 20 ++++++-------------- 1 file 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) pr_err("cannot register IRQ\n"); goto unalloc; } - /* create soc device */ - mc_drv_ctx->socdev = platform_device_alloc("soc-audio", -1); - if (!mc_drv_ctx->socdev) { - pr_err("soc-audio device allocation failed\n"); - ret_val = -ENOMEM; - goto freeirq; - } - platform_set_drvdata(mc_drv_ctx->socdev, &snd_soc_card_mfld); - ret_val = platform_device_add(mc_drv_ctx->socdev); + /* register the soc card */ + snd_soc_card_mfld.dev = &pdev->dev; + ret_val = snd_soc_register_card(&snd_soc_card_mfld); if (ret_val) { - pr_err("Unable to add soc-audio device, err %d\n", ret_val); - goto unregister; + pr_debug("snd_soc_register_card failed %d\n", ret_val); + goto freeirq; } platform_set_drvdata(pdev, mc_drv_ctx); pr_debug("successfully exited probe\n"); return ret_val; -unregister: - platform_device_put(mc_drv_ctx->socdev); freeirq: free_irq(irq, mc_drv_ctx); unalloc: @@ -424,7 +416,7 @@ static int __devexit snd_mfld_mc_remove(struct platform_device *pdev) pr_debug("snd_mfld_mc_remove called\n"); free_irq(platform_get_irq(pdev, 0), mc_drv_ctx); - platform_device_unregister(mc_drv_ctx->socdev); + snd_soc_unregister_card(&snd_soc_card_mfld); kfree(mc_drv_ctx); platform_set_drvdata(pdev, NULL); return 0;