Commit 70e7a023 authored by Peter Ujfalusi's avatar Peter Ujfalusi Committed by Mark Brown

ASoC: davinci-pcm: Convert to use devm_snd_soc_register_platform()

Remove the cleanup code related to the platform from the DAI drivers at the
same time to avoid breakage.
Signed-off-by: default avatarPeter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: default avatarMark Brown <broonie@linaro.org>
parent d5c6c59a
...@@ -757,7 +757,6 @@ static int davinci_i2s_remove(struct platform_device *pdev) ...@@ -757,7 +757,6 @@ static int davinci_i2s_remove(struct platform_device *pdev)
struct davinci_mcbsp_dev *dev = dev_get_drvdata(&pdev->dev); struct davinci_mcbsp_dev *dev = dev_get_drvdata(&pdev->dev);
snd_soc_unregister_component(&pdev->dev); snd_soc_unregister_component(&pdev->dev);
davinci_soc_platform_unregister(&pdev->dev);
clk_disable(dev->clk); clk_disable(dev->clk);
clk_put(dev->clk); clk_put(dev->clk);
......
...@@ -1254,23 +1254,8 @@ static int davinci_mcasp_probe(struct platform_device *pdev) ...@@ -1254,23 +1254,8 @@ static int davinci_mcasp_probe(struct platform_device *pdev)
static int davinci_mcasp_remove(struct platform_device *pdev) static int davinci_mcasp_remove(struct platform_device *pdev)
{ {
struct davinci_mcasp *mcasp = dev_get_drvdata(&pdev->dev);
snd_soc_unregister_component(&pdev->dev); snd_soc_unregister_component(&pdev->dev);
switch (mcasp->version) {
case MCASP_VERSION_1:
case MCASP_VERSION_2:
case MCASP_VERSION_3:
davinci_soc_platform_unregister(&pdev->dev);
break;
case MCASP_VERSION_4:
/* Using the resource managed omap-pcm as platform driver */
break;
default:
break;
}
pm_runtime_put_sync(&pdev->dev); pm_runtime_put_sync(&pdev->dev);
pm_runtime_disable(&pdev->dev); pm_runtime_disable(&pdev->dev);
......
...@@ -852,16 +852,10 @@ static struct snd_soc_platform_driver davinci_soc_platform = { ...@@ -852,16 +852,10 @@ static struct snd_soc_platform_driver davinci_soc_platform = {
int davinci_soc_platform_register(struct device *dev) int davinci_soc_platform_register(struct device *dev)
{ {
return snd_soc_register_platform(dev, &davinci_soc_platform); return devm_snd_soc_register_platform(dev, &davinci_soc_platform);
} }
EXPORT_SYMBOL_GPL(davinci_soc_platform_register); EXPORT_SYMBOL_GPL(davinci_soc_platform_register);
void davinci_soc_platform_unregister(struct device *dev)
{
snd_soc_unregister_platform(dev);
}
EXPORT_SYMBOL_GPL(davinci_soc_platform_unregister);
MODULE_AUTHOR("Vladimir Barinov"); MODULE_AUTHOR("Vladimir Barinov");
MODULE_DESCRIPTION("TI DAVINCI PCM DMA module"); MODULE_DESCRIPTION("TI DAVINCI PCM DMA module");
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
...@@ -31,15 +31,11 @@ struct davinci_pcm_dma_params { ...@@ -31,15 +31,11 @@ struct davinci_pcm_dma_params {
#if IS_ENABLED(CONFIG_SND_DAVINCI_SOC) #if IS_ENABLED(CONFIG_SND_DAVINCI_SOC)
int davinci_soc_platform_register(struct device *dev); int davinci_soc_platform_register(struct device *dev);
void davinci_soc_platform_unregister(struct device *dev);
#else #else
static inline int davinci_soc_platform_register(struct device *dev) static inline int davinci_soc_platform_register(struct device *dev)
{ {
return 0; return 0;
} }
static inline void davinci_soc_platform_unregister(struct device *dev)
{
}
#endif /* CONFIG_SND_DAVINCI_SOC */ #endif /* CONFIG_SND_DAVINCI_SOC */
#endif #endif
...@@ -258,7 +258,6 @@ static int davinci_vcif_probe(struct platform_device *pdev) ...@@ -258,7 +258,6 @@ static int davinci_vcif_probe(struct platform_device *pdev)
static int davinci_vcif_remove(struct platform_device *pdev) static int davinci_vcif_remove(struct platform_device *pdev)
{ {
snd_soc_unregister_component(&pdev->dev); snd_soc_unregister_component(&pdev->dev);
davinci_soc_platform_unregister(&pdev->dev);
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