diff options
author | Peter Ujfalusi <peter.ujfalusi@ti.com> | 2014-04-22 07:03:12 -0400 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2014-04-22 07:51:22 -0400 |
commit | 70e7a023cc9e9afafe503fa5533323ffe7091604 (patch) | |
tree | 521c50a76a32e39c38d21ad9927812f7b5574d90 | |
parent | d5c6c59a9d46113aebfd71f995b9e6e9af6a12b8 (diff) |
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: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
-rw-r--r-- | sound/soc/davinci/davinci-i2s.c | 1 | ||||
-rw-r--r-- | sound/soc/davinci/davinci-mcasp.c | 15 | ||||
-rw-r--r-- | sound/soc/davinci/davinci-pcm.c | 8 | ||||
-rw-r--r-- | sound/soc/davinci/davinci-pcm.h | 4 | ||||
-rw-r--r-- | sound/soc/davinci/davinci-vcif.c | 1 |
5 files changed, 1 insertions, 28 deletions
diff --git a/sound/soc/davinci/davinci-i2s.c b/sound/soc/davinci/davinci-i2s.c index ebe82947bab3..7682af31d6e6 100644 --- a/sound/soc/davinci/davinci-i2s.c +++ b/sound/soc/davinci/davinci-i2s.c | |||
@@ -757,7 +757,6 @@ static int davinci_i2s_remove(struct platform_device *pdev) | |||
757 | struct davinci_mcbsp_dev *dev = dev_get_drvdata(&pdev->dev); | 757 | struct davinci_mcbsp_dev *dev = dev_get_drvdata(&pdev->dev); |
758 | 758 | ||
759 | snd_soc_unregister_component(&pdev->dev); | 759 | snd_soc_unregister_component(&pdev->dev); |
760 | davinci_soc_platform_unregister(&pdev->dev); | ||
761 | 760 | ||
762 | clk_disable(dev->clk); | 761 | clk_disable(dev->clk); |
763 | clk_put(dev->clk); | 762 | clk_put(dev->clk); |
diff --git a/sound/soc/davinci/davinci-mcasp.c b/sound/soc/davinci/davinci-mcasp.c index d505fe7292a4..44a03840f76c 100644 --- a/sound/soc/davinci/davinci-mcasp.c +++ b/sound/soc/davinci/davinci-mcasp.c | |||
@@ -1254,23 +1254,8 @@ err_release_clk: | |||
1254 | 1254 | ||
1255 | static int davinci_mcasp_remove(struct platform_device *pdev) | 1255 | static int davinci_mcasp_remove(struct platform_device *pdev) |
1256 | { | 1256 | { |
1257 | struct davinci_mcasp *mcasp = dev_get_drvdata(&pdev->dev); | ||
1258 | |||
1259 | snd_soc_unregister_component(&pdev->dev); | 1257 | snd_soc_unregister_component(&pdev->dev); |
1260 | 1258 | ||
1261 | switch (mcasp->version) { | ||
1262 | case MCASP_VERSION_1: | ||
1263 | case MCASP_VERSION_2: | ||
1264 | case MCASP_VERSION_3: | ||
1265 | davinci_soc_platform_unregister(&pdev->dev); | ||
1266 | break; | ||
1267 | case MCASP_VERSION_4: | ||
1268 | /* Using the resource managed omap-pcm as platform driver */ | ||
1269 | break; | ||
1270 | default: | ||
1271 | break; | ||
1272 | } | ||
1273 | |||
1274 | pm_runtime_put_sync(&pdev->dev); | 1259 | pm_runtime_put_sync(&pdev->dev); |
1275 | pm_runtime_disable(&pdev->dev); | 1260 | pm_runtime_disable(&pdev->dev); |
1276 | 1261 | ||
diff --git a/sound/soc/davinci/davinci-pcm.c b/sound/soc/davinci/davinci-pcm.c index 14145cdf8a11..7809e9d935fc 100644 --- a/sound/soc/davinci/davinci-pcm.c +++ b/sound/soc/davinci/davinci-pcm.c | |||
@@ -852,16 +852,10 @@ static struct snd_soc_platform_driver davinci_soc_platform = { | |||
852 | 852 | ||
853 | int davinci_soc_platform_register(struct device *dev) | 853 | int davinci_soc_platform_register(struct device *dev) |
854 | { | 854 | { |
855 | return snd_soc_register_platform(dev, &davinci_soc_platform); | 855 | return devm_snd_soc_register_platform(dev, &davinci_soc_platform); |
856 | } | 856 | } |
857 | EXPORT_SYMBOL_GPL(davinci_soc_platform_register); | 857 | EXPORT_SYMBOL_GPL(davinci_soc_platform_register); |
858 | 858 | ||
859 | void davinci_soc_platform_unregister(struct device *dev) | ||
860 | { | ||
861 | snd_soc_unregister_platform(dev); | ||
862 | } | ||
863 | EXPORT_SYMBOL_GPL(davinci_soc_platform_unregister); | ||
864 | |||
865 | MODULE_AUTHOR("Vladimir Barinov"); | 859 | MODULE_AUTHOR("Vladimir Barinov"); |
866 | MODULE_DESCRIPTION("TI DAVINCI PCM DMA module"); | 860 | MODULE_DESCRIPTION("TI DAVINCI PCM DMA module"); |
867 | MODULE_LICENSE("GPL"); | 861 | MODULE_LICENSE("GPL"); |
diff --git a/sound/soc/davinci/davinci-pcm.h b/sound/soc/davinci/davinci-pcm.h index 5fd4737ab398..0fe2346a9aa2 100644 --- a/sound/soc/davinci/davinci-pcm.h +++ b/sound/soc/davinci/davinci-pcm.h | |||
@@ -31,15 +31,11 @@ struct davinci_pcm_dma_params { | |||
31 | 31 | ||
32 | #if IS_ENABLED(CONFIG_SND_DAVINCI_SOC) | 32 | #if IS_ENABLED(CONFIG_SND_DAVINCI_SOC) |
33 | int davinci_soc_platform_register(struct device *dev); | 33 | int davinci_soc_platform_register(struct device *dev); |
34 | void davinci_soc_platform_unregister(struct device *dev); | ||
35 | #else | 34 | #else |
36 | static inline int davinci_soc_platform_register(struct device *dev) | 35 | static inline int davinci_soc_platform_register(struct device *dev) |
37 | { | 36 | { |
38 | return 0; | 37 | return 0; |
39 | } | 38 | } |
40 | static inline void davinci_soc_platform_unregister(struct device *dev) | ||
41 | { | ||
42 | } | ||
43 | #endif /* CONFIG_SND_DAVINCI_SOC */ | 39 | #endif /* CONFIG_SND_DAVINCI_SOC */ |
44 | 40 | ||
45 | #endif | 41 | #endif |
diff --git a/sound/soc/davinci/davinci-vcif.c b/sound/soc/davinci/davinci-vcif.c index 30587c0cdbd2..77aef05588c3 100644 --- a/sound/soc/davinci/davinci-vcif.c +++ b/sound/soc/davinci/davinci-vcif.c | |||
@@ -258,7 +258,6 @@ static int davinci_vcif_probe(struct platform_device *pdev) | |||
258 | static int davinci_vcif_remove(struct platform_device *pdev) | 258 | static int davinci_vcif_remove(struct platform_device *pdev) |
259 | { | 259 | { |
260 | snd_soc_unregister_component(&pdev->dev); | 260 | snd_soc_unregister_component(&pdev->dev); |
261 | davinci_soc_platform_unregister(&pdev->dev); | ||
262 | 261 | ||
263 | return 0; | 262 | return 0; |
264 | } | 263 | } |