summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Ujfalusi <peter.ujfalusi@ti.com>2014-04-22 14:03:13 +0300
committerMark Brown <broonie@linaro.org>2014-04-22 12:51:22 +0100
commitb6bb370956204a0bcbba8ed78d0655c8b37c1ee3 (patch)
tree5d07381ebab823cb8518ad7645344e5c401b0d22
parent70e7a023cc9e9afafe503fa5533323ffe7091604 (diff)
downloadop-kernel-dev-b6bb370956204a0bcbba8ed78d0655c8b37c1ee3.zip
op-kernel-dev-b6bb370956204a0bcbba8ed78d0655c8b37c1ee3.tar.gz
ASoC: davinci-mcasp: Convert to use devm_snd_soc_register_component()
It allows to remove code from the cleanup paths. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Mark Brown <broonie@linaro.org>
-rw-r--r--sound/soc/davinci/davinci-mcasp.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/sound/soc/davinci/davinci-mcasp.c b/sound/soc/davinci/davinci-mcasp.c
index 44a0384..14058dc 100644
--- a/sound/soc/davinci/davinci-mcasp.c
+++ b/sound/soc/davinci/davinci-mcasp.c
@@ -1134,7 +1134,7 @@ static int davinci_mcasp_probe(struct platform_device *pdev)
if (!mcasp->base) {
dev_err(&pdev->dev, "ioremap failed\n");
ret = -ENOMEM;
- goto err_release_clk;
+ goto err;
}
mcasp->op_mode = pdata->op_mode;
@@ -1215,11 +1215,12 @@ static int davinci_mcasp_probe(struct platform_device *pdev)
mcasp_reparent_fck(pdev);
- ret = snd_soc_register_component(&pdev->dev, &davinci_mcasp_component,
- &davinci_mcasp_dai[pdata->op_mode], 1);
+ ret = devm_snd_soc_register_component(&pdev->dev,
+ &davinci_mcasp_component,
+ &davinci_mcasp_dai[pdata->op_mode], 1);
if (ret != 0)
- goto err_release_clk;
+ goto err;
switch (mcasp->version) {
case MCASP_VERSION_1:
@@ -1239,14 +1240,12 @@ static int davinci_mcasp_probe(struct platform_device *pdev)
if (ret) {
dev_err(&pdev->dev, "register PCM failed: %d\n", ret);
- goto err_unregister_component;
+ goto err;
}
return 0;
-err_unregister_component:
- snd_soc_unregister_component(&pdev->dev);
-err_release_clk:
+err:
pm_runtime_put_sync(&pdev->dev);
pm_runtime_disable(&pdev->dev);
return ret;
@@ -1254,8 +1253,6 @@ err_release_clk:
static int davinci_mcasp_remove(struct platform_device *pdev)
{
- snd_soc_unregister_component(&pdev->dev);
-
pm_runtime_put_sync(&pdev->dev);
pm_runtime_disable(&pdev->dev);
OpenPOWER on IntegriCloud