Skip to content

Commit

Permalink
ASoC: davinci-vcif: Use devm_snd_soc_register_component
Browse files Browse the repository at this point in the history
Use resource managed function devm_snd_soc_register_component for
component registration instead of snd_soc_register_component.

Also, remove davinci_vcif_remove as it is now redundant.

Signed-off-by: Vaishali Thakkar <vthakkar1994@gmail.com>
Acked-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
  • Loading branch information
Vaishali Thakkar authored and Mark Brown committed Aug 17, 2015
1 parent bc0195a commit 553de19
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions sound/soc/davinci/davinci-vcif.c
Original file line number Diff line number Diff line change
Expand Up @@ -231,8 +231,9 @@ static int davinci_vcif_probe(struct platform_device *pdev)

dev_set_drvdata(&pdev->dev, davinci_vcif_dev);

ret = snd_soc_register_component(&pdev->dev, &davinci_vcif_component,
&davinci_vcif_dai, 1);
ret = devm_snd_soc_register_component(&pdev->dev,
&davinci_vcif_component,
&davinci_vcif_dai, 1);
if (ret != 0) {
dev_err(&pdev->dev, "could not register dai\n");
return ret;
Expand All @@ -241,23 +242,14 @@ static int davinci_vcif_probe(struct platform_device *pdev)
ret = edma_pcm_platform_register(&pdev->dev);
if (ret) {
dev_err(&pdev->dev, "register PCM failed: %d\n", ret);
snd_soc_unregister_component(&pdev->dev);
return ret;
}

return 0;
}

static int davinci_vcif_remove(struct platform_device *pdev)
{
snd_soc_unregister_component(&pdev->dev);

return 0;
}

static struct platform_driver davinci_vcif_driver = {
.probe = davinci_vcif_probe,
.remove = davinci_vcif_remove,
.driver = {
.name = "davinci-vcif",
},
Expand Down

0 comments on commit 553de19

Please sign in to comment.