mirror of https://gitee.com/openkylin/linux.git
ASoC: fsl_spdif: Use devm_snd_soc_register_component
devm_snd_soc_register_component makes code simpler. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Signed-off-by: Mark Brown <broonie@linaro.org>
This commit is contained in:
parent
67a48b8181
commit
256218ae65
|
@ -1172,7 +1172,7 @@ static int fsl_spdif_probe(struct platform_device *pdev)
|
|||
/* Register with ASoC */
|
||||
dev_set_drvdata(&pdev->dev, spdif_priv);
|
||||
|
||||
ret = snd_soc_register_component(&pdev->dev, &fsl_spdif_component,
|
||||
ret = devm_snd_soc_register_component(&pdev->dev, &fsl_spdif_component,
|
||||
&spdif_priv->cpu_dai_drv, 1);
|
||||
if (ret) {
|
||||
dev_err(&pdev->dev, "failed to register DAI: %d\n", ret);
|
||||
|
@ -1180,15 +1180,8 @@ static int fsl_spdif_probe(struct platform_device *pdev)
|
|||
}
|
||||
|
||||
ret = imx_pcm_dma_init(pdev);
|
||||
if (ret) {
|
||||
if (ret)
|
||||
dev_err(&pdev->dev, "imx_pcm_dma_init failed: %d\n", ret);
|
||||
goto error_component;
|
||||
}
|
||||
|
||||
return ret;
|
||||
|
||||
error_component:
|
||||
snd_soc_unregister_component(&pdev->dev);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
@ -1196,7 +1189,6 @@ static int fsl_spdif_probe(struct platform_device *pdev)
|
|||
static int fsl_spdif_remove(struct platform_device *pdev)
|
||||
{
|
||||
imx_pcm_dma_exit(pdev);
|
||||
snd_soc_unregister_component(&pdev->dev);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue