Commit d58198b9 authored by Vinod Koul's avatar Vinod Koul Committed by Mark Brown

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: default avatarVinod Koul <vinod.koul@intel.com>
Signed-off-by: default avatarHarsha Priya <priya.harsha@intel.com>
Acked-by: default avatarLiam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
parent 65e9625e
...@@ -392,25 +392,17 @@ static int __devinit snd_mfld_mc_probe(struct platform_device *pdev) ...@@ -392,25 +392,17 @@ static int __devinit snd_mfld_mc_probe(struct platform_device *pdev)
pr_err("cannot register IRQ\n"); pr_err("cannot register IRQ\n");
goto unalloc; goto unalloc;
} }
/* create soc device */ /* register the soc card */
mc_drv_ctx->socdev = platform_device_alloc("soc-audio", -1); snd_soc_card_mfld.dev = &pdev->dev;
if (!mc_drv_ctx->socdev) { ret_val = snd_soc_register_card(&snd_soc_card_mfld);
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);
if (ret_val) { if (ret_val) {
pr_err("Unable to add soc-audio device, err %d\n", ret_val); pr_debug("snd_soc_register_card failed %d\n", ret_val);
goto unregister; goto freeirq;
} }
platform_set_drvdata(pdev, mc_drv_ctx); platform_set_drvdata(pdev, mc_drv_ctx);
pr_debug("successfully exited probe\n"); pr_debug("successfully exited probe\n");
return ret_val; return ret_val;
unregister:
platform_device_put(mc_drv_ctx->socdev);
freeirq: freeirq:
free_irq(irq, mc_drv_ctx); free_irq(irq, mc_drv_ctx);
unalloc: unalloc:
...@@ -424,7 +416,7 @@ static int __devexit snd_mfld_mc_remove(struct platform_device *pdev) ...@@ -424,7 +416,7 @@ static int __devexit snd_mfld_mc_remove(struct platform_device *pdev)
pr_debug("snd_mfld_mc_remove called\n"); pr_debug("snd_mfld_mc_remove called\n");
free_irq(platform_get_irq(pdev, 0), mc_drv_ctx); 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); kfree(mc_drv_ctx);
platform_set_drvdata(pdev, NULL); platform_set_drvdata(pdev, NULL);
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment