[alsa-devel] [PATCH v2 00/23] ASoC: use devm_xxx
![](https://secure.gravatar.com/avatar/2ea1ea42072986bc3dd023464d0c2de6.jpg?s=120&d=mm&r=g)
Hi Mark
These are v2 patch of converting for devm_xxx(). v2 is caring about related empty functions.
Kuninori Morimoto (23): ASoC: atmel: atmel-pcm-dma.c: use devm_snd_dmaengine_pcm_register() ASoC: sunxi: sun4i-i2s.c: use devm_snd_dmaengine_pcm_register() ASoC: tegra: tegra_pcm.c: use devm_snd_dmaengine_pcm_register() ASoC: ux500: ux500_pcm.c: use devm_snd_dmaengine_pcm_register() ASoC: au1x: i2sc.c: use devm_snd_soc_register_component() ASoC: au1x: ac97c.c: use devm_snd_soc_register_component() ASoC: au1x: psc-ac97.c: use devm_snd_soc_register_component() ASoC: au1x: psc-i2s.c: use devm_snd_soc_register_component() ASoC: cirrus: ep93xx-i2s.c: use devm_snd_soc_register_component() ASoC: cirrus: ep93xx-ac97.c: use devm_snd_soc_register_component() ASoC: rt5682: use devm_snd_soc_register_component() ASoC: ak4118: use devm_snd_soc_register_component() ASoC: cros_ec_codec: use devm_snd_soc_register_component() ASoC: fsl: imx-ssi.c: use devm_snd_soc_register_component() ASoC: fsl: mpc5200_psc_i2s.c: use devm_snd_soc_register_component() ASoC: fsl: mpc5200_psc_ac97.c: use devm_snd_soc_register_component() ASoC: pxa: pxa2xx-ac97.c: use devm_snd_soc_register_component() ASoC: tegra: tegra20_i2s.c: use devm_snd_soc_register_component() ASoC: tegra: tegra20_spdif.c: use devm_snd_soc_register_component() ASoC: tegra: tegra20_ac97.c: use devm_snd_soc_register_component() ASoC: tegra: tegra30_i2s.c: use devm_snd_soc_register_component() ASoC: ti: davinci-i2s.c: use devm_snd_soc_register_component() ASoC: ux500: ux500_msp_dai.c: use devm_snd_soc_register_component()
sound/soc/atmel/atmel-pcm-dma.c | 9 ++------- sound/soc/atmel/atmel-pcm-pdc.c | 5 ----- sound/soc/atmel/atmel-pcm.h | 8 -------- sound/soc/atmel/atmel_ssc_dai.c | 11 ----------- sound/soc/au1x/ac97c.c | 4 +--- sound/soc/au1x/i2sc.c | 4 +--- sound/soc/au1x/psc-ac97.c | 6 ++---- sound/soc/au1x/psc-i2s.c | 6 ++---- sound/soc/cirrus/ep93xx-ac97.c | 10 +++------- sound/soc/cirrus/ep93xx-i2s.c | 7 ++----- sound/soc/codecs/ak4118.c | 11 ++--------- sound/soc/codecs/cros_ec_codec.c | 2 +- sound/soc/codecs/rt5682.c | 13 +++---------- sound/soc/fsl/imx-ssi.c | 8 ++------ sound/soc/fsl/mpc5200_psc_ac97.c | 3 +-- sound/soc/fsl/mpc5200_psc_i2s.c | 3 +-- sound/soc/pxa/pxa2xx-ac97.c | 3 +-- sound/soc/sunxi/sun4i-i2s.c | 4 +--- sound/soc/tegra/tegra20_ac97.c | 11 +++-------- sound/soc/tegra/tegra20_i2s.c | 11 +++-------- sound/soc/tegra/tegra20_spdif.c | 12 ++++-------- sound/soc/tegra/tegra30_i2s.c | 11 +++-------- sound/soc/tegra/tegra_pcm.c | 11 +++-------- sound/soc/tegra/tegra_pcm.h | 1 - sound/soc/ti/davinci-i2s.c | 8 ++------ sound/soc/ux500/ux500_msp_dai.c | 12 ++---------- sound/soc/ux500/ux500_pcm.c | 9 +-------- sound/soc/ux500/ux500_pcm.h | 1 - 28 files changed, 46 insertions(+), 158 deletions(-)
![](https://secure.gravatar.com/avatar/2ea1ea42072986bc3dd023464d0c2de6.jpg?s=120&d=mm&r=g)
From: Kuninori Morimoto kuninori.morimoto.gx@renesas.com
We have devm_xxx version of snd_dmaengine_pcm_register, let's use it.
This patch also removes related empty functions
Signed-off-by: Kuninori Morimoto kuninori.morimoto.gx@renesas.com --- v1 -> v2
- remove empty functions
sound/soc/atmel/atmel-pcm-dma.c | 9 ++------- sound/soc/atmel/atmel-pcm-pdc.c | 5 ----- sound/soc/atmel/atmel-pcm.h | 8 -------- sound/soc/atmel/atmel_ssc_dai.c | 11 ----------- 4 files changed, 2 insertions(+), 31 deletions(-)
diff --git a/sound/soc/atmel/atmel-pcm-dma.c b/sound/soc/atmel/atmel-pcm-dma.c index 042e593..db67f5b 100644 --- a/sound/soc/atmel/atmel-pcm-dma.c +++ b/sound/soc/atmel/atmel-pcm-dma.c @@ -111,16 +111,11 @@ static const struct snd_dmaengine_pcm_config atmel_dmaengine_pcm_config = {
int atmel_pcm_dma_platform_register(struct device *dev) { - return snd_dmaengine_pcm_register(dev, &atmel_dmaengine_pcm_config, 0); + return devm_snd_dmaengine_pcm_register(dev, + &atmel_dmaengine_pcm_config, 0); } EXPORT_SYMBOL(atmel_pcm_dma_platform_register);
-void atmel_pcm_dma_platform_unregister(struct device *dev) -{ - snd_dmaengine_pcm_unregister(dev); -} -EXPORT_SYMBOL(atmel_pcm_dma_platform_unregister); - MODULE_AUTHOR("Bo Shen voice.shen@atmel.com"); MODULE_DESCRIPTION("Atmel DMA based PCM module"); MODULE_LICENSE("GPL"); diff --git a/sound/soc/atmel/atmel-pcm-pdc.c b/sound/soc/atmel/atmel-pcm-pdc.c index 7e9aa70..ed095af 100644 --- a/sound/soc/atmel/atmel-pcm-pdc.c +++ b/sound/soc/atmel/atmel-pcm-pdc.c @@ -393,11 +393,6 @@ int atmel_pcm_pdc_platform_register(struct device *dev) } EXPORT_SYMBOL(atmel_pcm_pdc_platform_register);
-void atmel_pcm_pdc_platform_unregister(struct device *dev) -{ -} -EXPORT_SYMBOL(atmel_pcm_pdc_platform_unregister); - MODULE_AUTHOR("Sedji Gaouaou sedji.gaouaou@atmel.com"); MODULE_DESCRIPTION("Atmel PCM module"); MODULE_LICENSE("GPL"); diff --git a/sound/soc/atmel/atmel-pcm.h b/sound/soc/atmel/atmel-pcm.h index 5173c9b..2e64874 100644 --- a/sound/soc/atmel/atmel-pcm.h +++ b/sound/soc/atmel/atmel-pcm.h @@ -72,28 +72,20 @@ struct atmel_pcm_dma_params {
#if IS_ENABLED(CONFIG_SND_ATMEL_SOC_PDC) int atmel_pcm_pdc_platform_register(struct device *dev); -void atmel_pcm_pdc_platform_unregister(struct device *dev); #else static inline int atmel_pcm_pdc_platform_register(struct device *dev) { return 0; } -static inline void atmel_pcm_pdc_platform_unregister(struct device *dev) -{ -} #endif
#if IS_ENABLED(CONFIG_SND_ATMEL_SOC_DMA) int atmel_pcm_dma_platform_register(struct device *dev); -void atmel_pcm_dma_platform_unregister(struct device *dev); #else static inline int atmel_pcm_dma_platform_register(struct device *dev) { return 0; } -static inline void atmel_pcm_dma_platform_unregister(struct device *dev) -{ -} #endif
#endif /* _ATMEL_PCM_H */ diff --git a/sound/soc/atmel/atmel_ssc_dai.c b/sound/soc/atmel/atmel_ssc_dai.c index b66c778..6f89483 100644 --- a/sound/soc/atmel/atmel_ssc_dai.c +++ b/sound/soc/atmel/atmel_ssc_dai.c @@ -1012,16 +1012,6 @@ static int asoc_ssc_init(struct device *dev) return 0; }
-static void asoc_ssc_exit(struct device *dev) -{ - struct ssc_device *ssc = dev_get_drvdata(dev); - - if (ssc->pdata->use_dma) - atmel_pcm_dma_platform_unregister(dev); - else - atmel_pcm_pdc_platform_unregister(dev); -} - /** * atmel_ssc_set_audio - Allocate the specified SSC for audio use. */ @@ -1050,7 +1040,6 @@ void atmel_ssc_put_audio(int ssc_id) { struct ssc_device *ssc = ssc_info[ssc_id].ssc;
- asoc_ssc_exit(&ssc->pdev->dev); ssc_free(ssc); } EXPORT_SYMBOL_GPL(atmel_ssc_put_audio);
![](https://secure.gravatar.com/avatar/d44283e3c2b00ae6f9ad4ec22da61e00.jpg?s=120&d=mm&r=g)
On 28.06.2019 07:07, Kuninori Morimoto wrote:
External E-Mail
From: Kuninori Morimoto kuninori.morimoto.gx@renesas.com
We have devm_xxx version of snd_dmaengine_pcm_register, let's use it.
This patch also removes related empty functions
Signed-off-by: Kuninori Morimoto kuninori.morimoto.gx@renesas.com
Reviewed-by: Codrin Ciubotariu codrin.ciubotariu@microchip.com
Thanks again!
Best regards, Codrin
v1 -> v2
- remove empty functions
sound/soc/atmel/atmel-pcm-dma.c | 9 ++------- sound/soc/atmel/atmel-pcm-pdc.c | 5 ----- sound/soc/atmel/atmel-pcm.h | 8 -------- sound/soc/atmel/atmel_ssc_dai.c | 11 ----------- 4 files changed, 2 insertions(+), 31 deletions(-)
diff --git a/sound/soc/atmel/atmel-pcm-dma.c b/sound/soc/atmel/atmel-pcm-dma.c index 042e593..db67f5b 100644 --- a/sound/soc/atmel/atmel-pcm-dma.c +++ b/sound/soc/atmel/atmel-pcm-dma.c @@ -111,16 +111,11 @@ static const struct snd_dmaengine_pcm_config atmel_dmaengine_pcm_config = {
int atmel_pcm_dma_platform_register(struct device *dev) {
- return snd_dmaengine_pcm_register(dev, &atmel_dmaengine_pcm_config, 0);
- return devm_snd_dmaengine_pcm_register(dev,
} EXPORT_SYMBOL(atmel_pcm_dma_platform_register);&atmel_dmaengine_pcm_config, 0);
-void atmel_pcm_dma_platform_unregister(struct device *dev) -{
- snd_dmaengine_pcm_unregister(dev);
-} -EXPORT_SYMBOL(atmel_pcm_dma_platform_unregister);
- MODULE_AUTHOR("Bo Shen voice.shen@atmel.com"); MODULE_DESCRIPTION("Atmel DMA based PCM module"); MODULE_LICENSE("GPL");
diff --git a/sound/soc/atmel/atmel-pcm-pdc.c b/sound/soc/atmel/atmel-pcm-pdc.c index 7e9aa70..ed095af 100644 --- a/sound/soc/atmel/atmel-pcm-pdc.c +++ b/sound/soc/atmel/atmel-pcm-pdc.c @@ -393,11 +393,6 @@ int atmel_pcm_pdc_platform_register(struct device *dev) } EXPORT_SYMBOL(atmel_pcm_pdc_platform_register);
-void atmel_pcm_pdc_platform_unregister(struct device *dev) -{ -} -EXPORT_SYMBOL(atmel_pcm_pdc_platform_unregister);
- MODULE_AUTHOR("Sedji Gaouaou sedji.gaouaou@atmel.com"); MODULE_DESCRIPTION("Atmel PCM module"); MODULE_LICENSE("GPL");
diff --git a/sound/soc/atmel/atmel-pcm.h b/sound/soc/atmel/atmel-pcm.h index 5173c9b..2e64874 100644 --- a/sound/soc/atmel/atmel-pcm.h +++ b/sound/soc/atmel/atmel-pcm.h @@ -72,28 +72,20 @@ struct atmel_pcm_dma_params {
#if IS_ENABLED(CONFIG_SND_ATMEL_SOC_PDC) int atmel_pcm_pdc_platform_register(struct device *dev); -void atmel_pcm_pdc_platform_unregister(struct device *dev); #else static inline int atmel_pcm_pdc_platform_register(struct device *dev) { return 0; } -static inline void atmel_pcm_pdc_platform_unregister(struct device *dev) -{ -} #endif
#if IS_ENABLED(CONFIG_SND_ATMEL_SOC_DMA) int atmel_pcm_dma_platform_register(struct device *dev); -void atmel_pcm_dma_platform_unregister(struct device *dev); #else static inline int atmel_pcm_dma_platform_register(struct device *dev) { return 0; } -static inline void atmel_pcm_dma_platform_unregister(struct device *dev) -{ -} #endif
#endif /* _ATMEL_PCM_H */ diff --git a/sound/soc/atmel/atmel_ssc_dai.c b/sound/soc/atmel/atmel_ssc_dai.c index b66c778..6f89483 100644 --- a/sound/soc/atmel/atmel_ssc_dai.c +++ b/sound/soc/atmel/atmel_ssc_dai.c @@ -1012,16 +1012,6 @@ static int asoc_ssc_init(struct device *dev) return 0; }
-static void asoc_ssc_exit(struct device *dev) -{
- struct ssc_device *ssc = dev_get_drvdata(dev);
- if (ssc->pdata->use_dma)
atmel_pcm_dma_platform_unregister(dev);
- else
atmel_pcm_pdc_platform_unregister(dev);
-}
- /**
*/
- atmel_ssc_set_audio - Allocate the specified SSC for audio use.
@@ -1050,7 +1040,6 @@ void atmel_ssc_put_audio(int ssc_id) { struct ssc_device *ssc = ssc_info[ssc_id].ssc;
- asoc_ssc_exit(&ssc->pdev->dev); ssc_free(ssc); } EXPORT_SYMBOL_GPL(atmel_ssc_put_audio);
![](https://secure.gravatar.com/avatar/d930951cb00393ecf9c3db3a56d78fa9.jpg?s=120&d=mm&r=g)
The patch
ASoC: atmel: atmel-pcm-dma.c: use devm_snd_dmaengine_pcm_register()
has been applied to the asoc tree at
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-5.3
All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying to this mail.
Thanks, Mark
From 8af26493c03581ad476a77630502de6152cf013d Mon Sep 17 00:00:00 2001
From: Kuninori Morimoto kuninori.morimoto.gx@renesas.com Date: Fri, 28 Jun 2019 13:07:05 +0900 Subject: [PATCH] ASoC: atmel: atmel-pcm-dma.c: use devm_snd_dmaengine_pcm_register()
We have devm_xxx version of snd_dmaengine_pcm_register, let's use it.
This patch also removes related empty functions
Signed-off-by: Kuninori Morimoto kuninori.morimoto.gx@renesas.com Reviewed-by: Codrin Ciubotariu codrin.ciubotariu@microchip.com Signed-off-by: Mark Brown broonie@kernel.org --- sound/soc/atmel/atmel-pcm-dma.c | 9 ++------- sound/soc/atmel/atmel-pcm-pdc.c | 5 ----- sound/soc/atmel/atmel-pcm.h | 8 -------- sound/soc/atmel/atmel_ssc_dai.c | 11 ----------- 4 files changed, 2 insertions(+), 31 deletions(-)
diff --git a/sound/soc/atmel/atmel-pcm-dma.c b/sound/soc/atmel/atmel-pcm-dma.c index 042e59309bcd..db67f5ba1e9a 100644 --- a/sound/soc/atmel/atmel-pcm-dma.c +++ b/sound/soc/atmel/atmel-pcm-dma.c @@ -111,16 +111,11 @@ static const struct snd_dmaengine_pcm_config atmel_dmaengine_pcm_config = {
int atmel_pcm_dma_platform_register(struct device *dev) { - return snd_dmaengine_pcm_register(dev, &atmel_dmaengine_pcm_config, 0); + return devm_snd_dmaengine_pcm_register(dev, + &atmel_dmaengine_pcm_config, 0); } EXPORT_SYMBOL(atmel_pcm_dma_platform_register);
-void atmel_pcm_dma_platform_unregister(struct device *dev) -{ - snd_dmaengine_pcm_unregister(dev); -} -EXPORT_SYMBOL(atmel_pcm_dma_platform_unregister); - MODULE_AUTHOR("Bo Shen voice.shen@atmel.com"); MODULE_DESCRIPTION("Atmel DMA based PCM module"); MODULE_LICENSE("GPL"); diff --git a/sound/soc/atmel/atmel-pcm-pdc.c b/sound/soc/atmel/atmel-pcm-pdc.c index 7e9aa7003305..ed095af866db 100644 --- a/sound/soc/atmel/atmel-pcm-pdc.c +++ b/sound/soc/atmel/atmel-pcm-pdc.c @@ -393,11 +393,6 @@ int atmel_pcm_pdc_platform_register(struct device *dev) } EXPORT_SYMBOL(atmel_pcm_pdc_platform_register);
-void atmel_pcm_pdc_platform_unregister(struct device *dev) -{ -} -EXPORT_SYMBOL(atmel_pcm_pdc_platform_unregister); - MODULE_AUTHOR("Sedji Gaouaou sedji.gaouaou@atmel.com"); MODULE_DESCRIPTION("Atmel PCM module"); MODULE_LICENSE("GPL"); diff --git a/sound/soc/atmel/atmel-pcm.h b/sound/soc/atmel/atmel-pcm.h index 5173c9b529ba..2e648748e5cb 100644 --- a/sound/soc/atmel/atmel-pcm.h +++ b/sound/soc/atmel/atmel-pcm.h @@ -72,28 +72,20 @@ struct atmel_pcm_dma_params {
#if IS_ENABLED(CONFIG_SND_ATMEL_SOC_PDC) int atmel_pcm_pdc_platform_register(struct device *dev); -void atmel_pcm_pdc_platform_unregister(struct device *dev); #else static inline int atmel_pcm_pdc_platform_register(struct device *dev) { return 0; } -static inline void atmel_pcm_pdc_platform_unregister(struct device *dev) -{ -} #endif
#if IS_ENABLED(CONFIG_SND_ATMEL_SOC_DMA) int atmel_pcm_dma_platform_register(struct device *dev); -void atmel_pcm_dma_platform_unregister(struct device *dev); #else static inline int atmel_pcm_dma_platform_register(struct device *dev) { return 0; } -static inline void atmel_pcm_dma_platform_unregister(struct device *dev) -{ -} #endif
#endif /* _ATMEL_PCM_H */ diff --git a/sound/soc/atmel/atmel_ssc_dai.c b/sound/soc/atmel/atmel_ssc_dai.c index b66c7789d096..6f89483ac88c 100644 --- a/sound/soc/atmel/atmel_ssc_dai.c +++ b/sound/soc/atmel/atmel_ssc_dai.c @@ -1012,16 +1012,6 @@ static int asoc_ssc_init(struct device *dev) return 0; }
-static void asoc_ssc_exit(struct device *dev) -{ - struct ssc_device *ssc = dev_get_drvdata(dev); - - if (ssc->pdata->use_dma) - atmel_pcm_dma_platform_unregister(dev); - else - atmel_pcm_pdc_platform_unregister(dev); -} - /** * atmel_ssc_set_audio - Allocate the specified SSC for audio use. */ @@ -1050,7 +1040,6 @@ void atmel_ssc_put_audio(int ssc_id) { struct ssc_device *ssc = ssc_info[ssc_id].ssc;
- asoc_ssc_exit(&ssc->pdev->dev); ssc_free(ssc); } EXPORT_SYMBOL_GPL(atmel_ssc_put_audio);
![](https://secure.gravatar.com/avatar/2ea1ea42072986bc3dd023464d0c2de6.jpg?s=120&d=mm&r=g)
From: Kuninori Morimoto kuninori.morimoto.gx@renesas.com
We have devm_xxx version of snd_dmaengine_pcm_register, let's use it.
Signed-off-by: Kuninori Morimoto kuninori.morimoto.gx@renesas.com --- v1 -> v2
- no change
sound/soc/sunxi/sun4i-i2s.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/sound/soc/sunxi/sun4i-i2s.c b/sound/soc/sunxi/sun4i-i2s.c index 9b22329..64a9fea 100644 --- a/sound/soc/sunxi/sun4i-i2s.c +++ b/sound/soc/sunxi/sun4i-i2s.c @@ -1156,7 +1156,7 @@ static int sun4i_i2s_probe(struct platform_device *pdev) goto err_suspend; }
- ret = snd_dmaengine_pcm_register(&pdev->dev, NULL, 0); + ret = devm_snd_dmaengine_pcm_register(&pdev->dev, NULL, 0); if (ret) { dev_err(&pdev->dev, "Could not register PCM\n"); goto err_suspend; @@ -1185,8 +1185,6 @@ static int sun4i_i2s_remove(struct platform_device *pdev) { struct sun4i_i2s *i2s = dev_get_drvdata(&pdev->dev);
- snd_dmaengine_pcm_unregister(&pdev->dev); - pm_runtime_disable(&pdev->dev); if (!pm_runtime_status_suspended(&pdev->dev)) sun4i_i2s_runtime_suspend(&pdev->dev);
![](https://secure.gravatar.com/avatar/2ea1ea42072986bc3dd023464d0c2de6.jpg?s=120&d=mm&r=g)
From: Kuninori Morimoto kuninori.morimoto.gx@renesas.com
We have devm_xxx version of snd_dmaengine_pcm_register, let's use it.
This patch also removes related empty functions
Signed-off-by: Kuninori Morimoto kuninori.morimoto.gx@renesas.com --- v1 -> v2
- remove empty functions
sound/soc/tegra/tegra20_ac97.c | 1 - sound/soc/tegra/tegra20_i2s.c | 1 - sound/soc/tegra/tegra20_spdif.c | 1 - sound/soc/tegra/tegra30_i2s.c | 1 - sound/soc/tegra/tegra_pcm.c | 11 +++-------- sound/soc/tegra/tegra_pcm.h | 1 - 6 files changed, 3 insertions(+), 13 deletions(-)
diff --git a/sound/soc/tegra/tegra20_ac97.c b/sound/soc/tegra/tegra20_ac97.c index 09c8516..7c359c4 100644 --- a/sound/soc/tegra/tegra20_ac97.c +++ b/sound/soc/tegra/tegra20_ac97.c @@ -410,7 +410,6 @@ static int tegra20_ac97_platform_remove(struct platform_device *pdev) { struct tegra20_ac97 *ac97 = dev_get_drvdata(&pdev->dev);
- tegra_pcm_platform_unregister(&pdev->dev); snd_soc_unregister_component(&pdev->dev);
clk_disable_unprepare(ac97->clk_ac97); diff --git a/sound/soc/tegra/tegra20_i2s.c b/sound/soc/tegra/tegra20_i2s.c index 005fc4e6..fd94911 100644 --- a/sound/soc/tegra/tegra20_i2s.c +++ b/sound/soc/tegra/tegra20_i2s.c @@ -413,7 +413,6 @@ static int tegra20_i2s_platform_remove(struct platform_device *pdev) if (!pm_runtime_status_suspended(&pdev->dev)) tegra20_i2s_runtime_suspend(&pdev->dev);
- tegra_pcm_platform_unregister(&pdev->dev); snd_soc_unregister_component(&pdev->dev);
clk_put(i2s->clk_i2s); diff --git a/sound/soc/tegra/tegra20_spdif.c b/sound/soc/tegra/tegra20_spdif.c index 5839833..cde526d 100644 --- a/sound/soc/tegra/tegra20_spdif.c +++ b/sound/soc/tegra/tegra20_spdif.c @@ -333,7 +333,6 @@ static int tegra20_spdif_platform_remove(struct platform_device *pdev) if (!pm_runtime_status_suspended(&pdev->dev)) tegra20_spdif_runtime_suspend(&pdev->dev);
- tegra_pcm_platform_unregister(&pdev->dev); snd_soc_unregister_component(&pdev->dev);
return 0; diff --git a/sound/soc/tegra/tegra30_i2s.c b/sound/soc/tegra/tegra30_i2s.c index ac6983c..2f70bf0 100644 --- a/sound/soc/tegra/tegra30_i2s.c +++ b/sound/soc/tegra/tegra30_i2s.c @@ -510,7 +510,6 @@ static int tegra30_i2s_platform_remove(struct platform_device *pdev) if (!pm_runtime_status_suspended(&pdev->dev)) tegra30_i2s_runtime_suspend(&pdev->dev);
- tegra_pcm_platform_unregister(&pdev->dev); snd_soc_unregister_component(&pdev->dev);
tegra30_ahub_unset_rx_cif_source(i2s->capture_fifo_cif); diff --git a/sound/soc/tegra/tegra_pcm.c b/sound/soc/tegra/tegra_pcm.c index f246df8..c532555 100644 --- a/sound/soc/tegra/tegra_pcm.c +++ b/sound/soc/tegra/tegra_pcm.c @@ -44,7 +44,8 @@ static const struct snd_dmaengine_pcm_config tegra_dmaengine_pcm_config = {
int tegra_pcm_platform_register(struct device *dev) { - return snd_dmaengine_pcm_register(dev, &tegra_dmaengine_pcm_config, 0); + return devm_snd_dmaengine_pcm_register(dev, + &tegra_dmaengine_pcm_config, 0); } EXPORT_SYMBOL_GPL(tegra_pcm_platform_register);
@@ -57,16 +58,10 @@ int tegra_pcm_platform_register_with_chan_names(struct device *dev, config->chan_names[0] = txdmachan; config->chan_names[1] = rxdmachan;
- return snd_dmaengine_pcm_register(dev, config, 0); + return devm_snd_dmaengine_pcm_register(dev, config, 0); } EXPORT_SYMBOL_GPL(tegra_pcm_platform_register_with_chan_names);
-void tegra_pcm_platform_unregister(struct device *dev) -{ - return snd_dmaengine_pcm_unregister(dev); -} -EXPORT_SYMBOL_GPL(tegra_pcm_platform_unregister); - MODULE_AUTHOR("Stephen Warren swarren@nvidia.com"); MODULE_DESCRIPTION("Tegra PCM ASoC driver"); MODULE_LICENSE("GPL"); diff --git a/sound/soc/tegra/tegra_pcm.h b/sound/soc/tegra/tegra_pcm.h index 0433372..6eb8f8d 100644 --- a/sound/soc/tegra/tegra_pcm.h +++ b/sound/soc/tegra/tegra_pcm.h @@ -23,6 +23,5 @@ int tegra_pcm_platform_register(struct device *dev); int tegra_pcm_platform_register_with_chan_names(struct device *dev, struct snd_dmaengine_pcm_config *config, char *txdmachan, char *rxdmachan); -void tegra_pcm_platform_unregister(struct device *dev);
#endif
![](https://secure.gravatar.com/avatar/2ea1ea42072986bc3dd023464d0c2de6.jpg?s=120&d=mm&r=g)
From: Kuninori Morimoto kuninori.morimoto.gx@renesas.com
We have devm_xxx version of snd_dmaengine_pcm_register, let's use it.
This patch also removes related empty functions
Signed-off-by: Kuninori Morimoto kuninori.morimoto.gx@renesas.com --- v1 -> v2
- remove empty functions
sound/soc/ux500/ux500_msp_dai.c | 2 -- sound/soc/ux500/ux500_pcm.c | 9 +-------- sound/soc/ux500/ux500_pcm.h | 1 - 3 files changed, 1 insertion(+), 11 deletions(-)
diff --git a/sound/soc/ux500/ux500_msp_dai.c b/sound/soc/ux500/ux500_msp_dai.c index dec065f..35669b7 100644 --- a/sound/soc/ux500/ux500_msp_dai.c +++ b/sound/soc/ux500/ux500_msp_dai.c @@ -827,8 +827,6 @@ static int ux500_msp_drv_remove(struct platform_device *pdev) { struct ux500_msp_i2s_drvdata *drvdata = dev_get_drvdata(&pdev->dev);
- ux500_pcm_unregister_platform(pdev); - snd_soc_unregister_component(&pdev->dev);
prcmu_qos_remove_requirement(PRCMU_QOS_APE_OPP, "ux500_msp_i2s"); diff --git a/sound/soc/ux500/ux500_pcm.c b/sound/soc/ux500/ux500_pcm.c index 9445dbe..58f00d9 100644 --- a/sound/soc/ux500/ux500_pcm.c +++ b/sound/soc/ux500/ux500_pcm.c @@ -143,7 +143,7 @@ int ux500_pcm_register_platform(struct platform_device *pdev) else pcm_config = &ux500_dmaengine_pcm_config;
- ret = snd_dmaengine_pcm_register(&pdev->dev, pcm_config, + ret = devm_snd_dmaengine_pcm_register(&pdev->dev, pcm_config, SND_DMAENGINE_PCM_FLAG_COMPAT); if (ret < 0) { dev_err(&pdev->dev, @@ -156,13 +156,6 @@ int ux500_pcm_register_platform(struct platform_device *pdev) } EXPORT_SYMBOL_GPL(ux500_pcm_register_platform);
-int ux500_pcm_unregister_platform(struct platform_device *pdev) -{ - snd_dmaengine_pcm_unregister(&pdev->dev); - return 0; -} -EXPORT_SYMBOL_GPL(ux500_pcm_unregister_platform); - MODULE_AUTHOR("Ola Lilja"); MODULE_AUTHOR("Roger Nilsson"); MODULE_DESCRIPTION("ASoC UX500 driver"); diff --git a/sound/soc/ux500/ux500_pcm.h b/sound/soc/ux500/ux500_pcm.h index ff3ef72..d05bff2 100644 --- a/sound/soc/ux500/ux500_pcm.h +++ b/sound/soc/ux500/ux500_pcm.h @@ -16,6 +16,5 @@ #include <linux/workqueue.h>
int ux500_pcm_register_platform(struct platform_device *pdev); -int ux500_pcm_unregister_platform(struct platform_device *pdev);
#endif
![](https://secure.gravatar.com/avatar/2ea1ea42072986bc3dd023464d0c2de6.jpg?s=120&d=mm&r=g)
From: Kuninori Morimoto kuninori.morimoto.gx@renesas.com
We have devm_xxx version of snd_soc_register_component, let's use it.
Signed-off-by: Kuninori Morimoto kuninori.morimoto.gx@renesas.com --- v1 -> v2
- no change
sound/soc/au1x/i2sc.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/sound/soc/au1x/i2sc.c b/sound/soc/au1x/i2sc.c index 46f2b44..6877365 100644 --- a/sound/soc/au1x/i2sc.c +++ b/sound/soc/au1x/i2sc.c @@ -265,7 +265,7 @@ static int au1xi2s_drvprobe(struct platform_device *pdev)
platform_set_drvdata(pdev, ctx);
- return snd_soc_register_component(&pdev->dev, &au1xi2s_component, + return devm_snd_soc_register_component(&pdev->dev, &au1xi2s_component, &au1xi2s_dai_driver, 1); }
@@ -273,8 +273,6 @@ static int au1xi2s_drvremove(struct platform_device *pdev) { struct au1xpsc_audio_data *ctx = platform_get_drvdata(pdev);
- snd_soc_unregister_component(&pdev->dev); - WR(ctx, I2S_ENABLE, EN_D); /* clock off, disable */
return 0;
![](https://secure.gravatar.com/avatar/2ea1ea42072986bc3dd023464d0c2de6.jpg?s=120&d=mm&r=g)
From: Kuninori Morimoto kuninori.morimoto.gx@renesas.com
We have devm_xxx version of snd_soc_register_component, let's use it.
Signed-off-by: Kuninori Morimoto kuninori.morimoto.gx@renesas.com --- v1 -> v2
- no change
sound/soc/au1x/ac97c.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/sound/soc/au1x/ac97c.c b/sound/soc/au1x/ac97c.c index 0792c40..6f2eca2 100644 --- a/sound/soc/au1x/ac97c.c +++ b/sound/soc/au1x/ac97c.c @@ -276,7 +276,7 @@ static int au1xac97c_drvprobe(struct platform_device *pdev) if (ret) return ret;
- ret = snd_soc_register_component(&pdev->dev, &au1xac97c_component, + ret = devm_snd_soc_register_component(&pdev->dev, &au1xac97c_component, &au1xac97c_dai_driver, 1); if (ret) return ret; @@ -289,8 +289,6 @@ static int au1xac97c_drvremove(struct platform_device *pdev) { struct au1xpsc_audio_data *ctx = platform_get_drvdata(pdev);
- snd_soc_unregister_component(&pdev->dev); - WR(ctx, AC97_ENABLE, EN_D); /* clock off, disable */
ac97c_workdata = NULL; /* MDEV */
![](https://secure.gravatar.com/avatar/2ea1ea42072986bc3dd023464d0c2de6.jpg?s=120&d=mm&r=g)
From: Kuninori Morimoto kuninori.morimoto.gx@renesas.com
We have devm_xxx version of snd_soc_register_component, let's use it.
Signed-off-by: Kuninori Morimoto kuninori.morimoto.gx@renesas.com --- v1 -> v2
- no change
sound/soc/au1x/psc-ac97.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/sound/soc/au1x/psc-ac97.c b/sound/soc/au1x/psc-ac97.c index 21e5f6a..0fd5478 100644 --- a/sound/soc/au1x/psc-ac97.c +++ b/sound/soc/au1x/psc-ac97.c @@ -413,8 +413,8 @@ static int au1xpsc_ac97_drvprobe(struct platform_device *pdev) if (ret) return ret;
- ret = snd_soc_register_component(&pdev->dev, &au1xpsc_ac97_component, - &wd->dai_drv, 1); + ret = devm_snd_soc_register_component(&pdev->dev, + &au1xpsc_ac97_component, &wd->dai_drv, 1); if (ret) return ret;
@@ -426,8 +426,6 @@ static int au1xpsc_ac97_drvremove(struct platform_device *pdev) { struct au1xpsc_audio_data *wd = platform_get_drvdata(pdev);
- snd_soc_unregister_component(&pdev->dev); - /* disable PSC completely */ __raw_writel(0, AC97_CFG(wd)); wmb(); /* drain writebuffer */
![](https://secure.gravatar.com/avatar/d930951cb00393ecf9c3db3a56d78fa9.jpg?s=120&d=mm&r=g)
On Fri, Jun 28, 2019 at 01:08:34PM +0900, Kuninori Morimoto wrote:
@@ -426,8 +426,6 @@ static int au1xpsc_ac97_drvremove(struct platform_device *pdev) { struct au1xpsc_audio_data *wd = platform_get_drvdata(pdev);
- snd_soc_unregister_component(&pdev->dev);
- /* disable PSC completely */ __raw_writel(0, AC97_CFG(wd)); wmb(); /* drain writebuffer */
I don't think this is 100% safe - with this change we will turn off the hardware block before we unregister the component which means that we might try to interact with it. If we're converting to devm then we need to be careful the ordering of the removal won't be affected.
![](https://secure.gravatar.com/avatar/2ea1ea42072986bc3dd023464d0c2de6.jpg?s=120&d=mm&r=g)
Hi Mark
@@ -426,8 +426,6 @@ static int au1xpsc_ac97_drvremove(struct platform_device *pdev) { struct au1xpsc_audio_data *wd = platform_get_drvdata(pdev);
- snd_soc_unregister_component(&pdev->dev);
- /* disable PSC completely */ __raw_writel(0, AC97_CFG(wd)); wmb(); /* drain writebuffer */
I don't think this is 100% safe - with this change we will turn off the hardware block before we unregister the component which means that we might try to interact with it. If we're converting to devm then we need to be careful the ordering of the removal won't be affected.
Hmm indeed. Thank you for your review.
Thank you for your help !! Best regards --- Kuninori Morimoto
![](https://secure.gravatar.com/avatar/2ea1ea42072986bc3dd023464d0c2de6.jpg?s=120&d=mm&r=g)
From: Kuninori Morimoto kuninori.morimoto.gx@renesas.com
We have devm_xxx version of snd_soc_register_component, let's use it.
Signed-off-by: Kuninori Morimoto kuninori.morimoto.gx@renesas.com --- v1 -> v2
- no change
sound/soc/au1x/psc-i2s.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/sound/soc/au1x/psc-i2s.c b/sound/soc/au1x/psc-i2s.c index 4a5a095..076303f 100644 --- a/sound/soc/au1x/psc-i2s.c +++ b/sound/soc/au1x/psc-i2s.c @@ -340,16 +340,14 @@ static int au1xpsc_i2s_drvprobe(struct platform_device *pdev)
platform_set_drvdata(pdev, wd);
- return snd_soc_register_component(&pdev->dev, &au1xpsc_i2s_component, - &wd->dai_drv, 1); + return devm_snd_soc_register_component(&pdev->dev, + &au1xpsc_i2s_component, &wd->dai_drv, 1); }
static int au1xpsc_i2s_drvremove(struct platform_device *pdev) { struct au1xpsc_audio_data *wd = platform_get_drvdata(pdev);
- snd_soc_unregister_component(&pdev->dev); - __raw_writel(0, I2S_CFG(wd)); wmb(); /* drain writebuffer */ __raw_writel(PSC_CTRL_DISABLE, PSC_CTRL(wd));
![](https://secure.gravatar.com/avatar/d930951cb00393ecf9c3db3a56d78fa9.jpg?s=120&d=mm&r=g)
The patch
ASoC: au1x: psc-i2s.c: use devm_snd_soc_register_component()
has been applied to the asoc tree at
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-5.3
All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying to this mail.
Thanks, Mark
From 7422104037773624d2a6cdb9becb68278befbd88 Mon Sep 17 00:00:00 2001
From: Kuninori Morimoto kuninori.morimoto.gx@renesas.com Date: Fri, 28 Jun 2019 13:08:48 +0900 Subject: [PATCH] ASoC: au1x: psc-i2s.c: use devm_snd_soc_register_component()
We have devm_xxx version of snd_soc_register_component, let's use it.
Signed-off-by: Kuninori Morimoto kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown broonie@kernel.org --- sound/soc/au1x/psc-i2s.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/sound/soc/au1x/psc-i2s.c b/sound/soc/au1x/psc-i2s.c index 4a5a095076f4..076303f96b8c 100644 --- a/sound/soc/au1x/psc-i2s.c +++ b/sound/soc/au1x/psc-i2s.c @@ -340,16 +340,14 @@ static int au1xpsc_i2s_drvprobe(struct platform_device *pdev)
platform_set_drvdata(pdev, wd);
- return snd_soc_register_component(&pdev->dev, &au1xpsc_i2s_component, - &wd->dai_drv, 1); + return devm_snd_soc_register_component(&pdev->dev, + &au1xpsc_i2s_component, &wd->dai_drv, 1); }
static int au1xpsc_i2s_drvremove(struct platform_device *pdev) { struct au1xpsc_audio_data *wd = platform_get_drvdata(pdev);
- snd_soc_unregister_component(&pdev->dev); - __raw_writel(0, I2S_CFG(wd)); wmb(); /* drain writebuffer */ __raw_writel(PSC_CTRL_DISABLE, PSC_CTRL(wd));
![](https://secure.gravatar.com/avatar/2ea1ea42072986bc3dd023464d0c2de6.jpg?s=120&d=mm&r=g)
From: Kuninori Morimoto kuninori.morimoto.gx@renesas.com
We have devm_xxx version of snd_soc_register_component, let's use it.
Signed-off-by: Kuninori Morimoto kuninori.morimoto.gx@renesas.com --- v1 -> v2
- no change
sound/soc/cirrus/ep93xx-i2s.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/sound/soc/cirrus/ep93xx-i2s.c b/sound/soc/cirrus/ep93xx-i2s.c index 6ca899b..0b4355e 100644 --- a/sound/soc/cirrus/ep93xx-i2s.c +++ b/sound/soc/cirrus/ep93xx-i2s.c @@ -473,19 +473,17 @@ static int ep93xx_i2s_probe(struct platform_device *pdev)
dev_set_drvdata(&pdev->dev, info);
- err = snd_soc_register_component(&pdev->dev, &ep93xx_i2s_component, + err = devm_snd_soc_register_component(&pdev->dev, &ep93xx_i2s_component, &ep93xx_i2s_dai, 1); if (err) goto fail_put_lrclk;
err = devm_ep93xx_pcm_platform_register(&pdev->dev); if (err) - goto fail_unregister; + goto fail_put_lrclk;
return 0;
-fail_unregister: - snd_soc_unregister_component(&pdev->dev); fail_put_lrclk: clk_put(info->lrclk); fail_put_sclk: @@ -500,7 +498,6 @@ static int ep93xx_i2s_remove(struct platform_device *pdev) { struct ep93xx_i2s_info *info = dev_get_drvdata(&pdev->dev);
- snd_soc_unregister_component(&pdev->dev); clk_put(info->lrclk); clk_put(info->sclk); clk_put(info->mclk);
![](https://secure.gravatar.com/avatar/d930951cb00393ecf9c3db3a56d78fa9.jpg?s=120&d=mm&r=g)
On Fri, Jun 28, 2019 at 01:09:00PM +0900, Kuninori Morimoto wrote:
struct ep93xx_i2s_info *info = dev_get_drvdata(&pdev->dev);
- snd_soc_unregister_component(&pdev->dev); clk_put(info->lrclk); clk_put(info->sclk); clk_put(info->mclk);
I'll apply this one since it already has issues with the platform registration and the fix is to convert to devm_clk_get().
![](https://secure.gravatar.com/avatar/2ea1ea42072986bc3dd023464d0c2de6.jpg?s=120&d=mm&r=g)
From: Kuninori Morimoto kuninori.morimoto.gx@renesas.com
We have devm_xxx version of snd_soc_register_component, let's use it.
Signed-off-by: Kuninori Morimoto kuninori.morimoto.gx@renesas.com --- v1 -> v2
- no change
sound/soc/cirrus/ep93xx-ac97.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-)
diff --git a/sound/soc/cirrus/ep93xx-ac97.c b/sound/soc/cirrus/ep93xx-ac97.c index 84c967f..f074857 100644 --- a/sound/soc/cirrus/ep93xx-ac97.c +++ b/sound/soc/cirrus/ep93xx-ac97.c @@ -397,19 +397,17 @@ static int ep93xx_ac97_probe(struct platform_device *pdev) if (ret) goto fail;
- ret = snd_soc_register_component(&pdev->dev, &ep93xx_ac97_component, - &ep93xx_ac97_dai, 1); + ret = devm_snd_soc_register_component(&pdev->dev, + &ep93xx_ac97_component, &ep93xx_ac97_dai, 1); if (ret) goto fail;
ret = devm_ep93xx_pcm_platform_register(&pdev->dev); if (ret) - goto fail_unregister; + goto fail;
return 0;
-fail_unregister: - snd_soc_unregister_component(&pdev->dev); fail: ep93xx_ac97_info = NULL; snd_soc_set_ac97_ops(NULL); @@ -420,8 +418,6 @@ static int ep93xx_ac97_remove(struct platform_device *pdev) { struct ep93xx_ac97_info *info = platform_get_drvdata(pdev);
- snd_soc_unregister_component(&pdev->dev); - /* disable the AC97 controller */ ep93xx_ac97_write_reg(info, AC97GCR, 0);
![](https://secure.gravatar.com/avatar/2ea1ea42072986bc3dd023464d0c2de6.jpg?s=120&d=mm&r=g)
From: Kuninori Morimoto kuninori.morimoto.gx@renesas.com
We have devm_xxx version of snd_soc_register_component, let's use it.
This patch also removes related empty functions
Signed-off-by: Kuninori Morimoto kuninori.morimoto.gx@renesas.com --- v1 -> v2
- remove empty functions
sound/soc/codecs/rt5682.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-)
diff --git a/sound/soc/codecs/rt5682.c b/sound/soc/codecs/rt5682.c index 78409dd..1ef4707 100644 --- a/sound/soc/codecs/rt5682.c +++ b/sound/soc/codecs/rt5682.c @@ -2662,15 +2662,9 @@ static int rt5682_i2c_probe(struct i2c_client *i2c,
}
- return snd_soc_register_component(&i2c->dev, &soc_component_dev_rt5682, - rt5682_dai, ARRAY_SIZE(rt5682_dai)); -} - -static int rt5682_i2c_remove(struct i2c_client *i2c) -{ - snd_soc_unregister_component(&i2c->dev); - - return 0; + return devm_snd_soc_register_component(&i2c->dev, + &soc_component_dev_rt5682, + rt5682_dai, ARRAY_SIZE(rt5682_dai)); }
static void rt5682_i2c_shutdown(struct i2c_client *client) @@ -2703,7 +2697,6 @@ static struct i2c_driver rt5682_i2c_driver = { .acpi_match_table = ACPI_PTR(rt5682_acpi_match), }, .probe = rt5682_i2c_probe, - .remove = rt5682_i2c_remove, .shutdown = rt5682_i2c_shutdown, .id_table = rt5682_i2c_id, };
![](https://secure.gravatar.com/avatar/d930951cb00393ecf9c3db3a56d78fa9.jpg?s=120&d=mm&r=g)
The patch
ASoC: rt5682: use devm_snd_soc_register_component()
has been applied to the asoc tree at
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-5.3
All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying to this mail.
Thanks, Mark
From 61c8a7d6ff11a31fc4ea47667c5f33119be7bcd3 Mon Sep 17 00:00:00 2001
From: Kuninori Morimoto kuninori.morimoto.gx@renesas.com Date: Fri, 28 Jun 2019 13:09:28 +0900 Subject: [PATCH] ASoC: rt5682: use devm_snd_soc_register_component()
We have devm_xxx version of snd_soc_register_component, let's use it.
This patch also removes related empty functions
Signed-off-by: Kuninori Morimoto kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown broonie@kernel.org --- sound/soc/codecs/rt5682.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-)
diff --git a/sound/soc/codecs/rt5682.c b/sound/soc/codecs/rt5682.c index 78409dd11488..1ef470700ed5 100644 --- a/sound/soc/codecs/rt5682.c +++ b/sound/soc/codecs/rt5682.c @@ -2662,15 +2662,9 @@ static int rt5682_i2c_probe(struct i2c_client *i2c,
}
- return snd_soc_register_component(&i2c->dev, &soc_component_dev_rt5682, - rt5682_dai, ARRAY_SIZE(rt5682_dai)); -} - -static int rt5682_i2c_remove(struct i2c_client *i2c) -{ - snd_soc_unregister_component(&i2c->dev); - - return 0; + return devm_snd_soc_register_component(&i2c->dev, + &soc_component_dev_rt5682, + rt5682_dai, ARRAY_SIZE(rt5682_dai)); }
static void rt5682_i2c_shutdown(struct i2c_client *client) @@ -2703,7 +2697,6 @@ static struct i2c_driver rt5682_i2c_driver = { .acpi_match_table = ACPI_PTR(rt5682_acpi_match), }, .probe = rt5682_i2c_probe, - .remove = rt5682_i2c_remove, .shutdown = rt5682_i2c_shutdown, .id_table = rt5682_i2c_id, };
![](https://secure.gravatar.com/avatar/2ea1ea42072986bc3dd023464d0c2de6.jpg?s=120&d=mm&r=g)
From: Kuninori Morimoto kuninori.morimoto.gx@renesas.com
We have devm_xxx version of snd_soc_register_component, let's use it.
This patch also removes related empty functions
Signed-off-by: Kuninori Morimoto kuninori.morimoto.gx@renesas.com --- v1 -> v2
- remove empty functions
sound/soc/codecs/ak4118.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-)
diff --git a/sound/soc/codecs/ak4118.c b/sound/soc/codecs/ak4118.c index ce419e8..f44d9a4 100644 --- a/sound/soc/codecs/ak4118.c +++ b/sound/soc/codecs/ak4118.c @@ -400,14 +400,8 @@ static int ak4118_i2c_probe(struct i2c_client *i2c, return ret; }
- return snd_soc_register_component(&i2c->dev, &soc_component_drv_ak4118, - &ak4118_dai, 1); -} - -static int ak4118_i2c_remove(struct i2c_client *i2c) -{ - snd_soc_unregister_component(&i2c->dev); - return 0; + return devm_snd_soc_register_component(&i2c->dev, + &soc_component_drv_ak4118, &ak4118_dai, 1); }
static const struct of_device_id ak4118_of_match[] = { @@ -429,7 +423,6 @@ static struct i2c_driver ak4118_i2c_driver = { }, .id_table = ak4118_id_table, .probe = ak4118_i2c_probe, - .remove = ak4118_i2c_remove, };
module_i2c_driver(ak4118_i2c_driver);
![](https://secure.gravatar.com/avatar/d930951cb00393ecf9c3db3a56d78fa9.jpg?s=120&d=mm&r=g)
The patch
ASoC: ak4118: use devm_snd_soc_register_component()
has been applied to the asoc tree at
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-5.3
All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying to this mail.
Thanks, Mark
From 35407f9ffd84560501f72ee3954344f8e5b49264 Mon Sep 17 00:00:00 2001
From: Kuninori Morimoto kuninori.morimoto.gx@renesas.com Date: Fri, 28 Jun 2019 13:09:40 +0900 Subject: [PATCH] ASoC: ak4118: use devm_snd_soc_register_component()
We have devm_xxx version of snd_soc_register_component, let's use it.
This patch also removes related empty functions
Signed-off-by: Kuninori Morimoto kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown broonie@kernel.org --- sound/soc/codecs/ak4118.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-)
diff --git a/sound/soc/codecs/ak4118.c b/sound/soc/codecs/ak4118.c index ce419e8cf890..f44d9a4a8507 100644 --- a/sound/soc/codecs/ak4118.c +++ b/sound/soc/codecs/ak4118.c @@ -400,14 +400,8 @@ static int ak4118_i2c_probe(struct i2c_client *i2c, return ret; }
- return snd_soc_register_component(&i2c->dev, &soc_component_drv_ak4118, - &ak4118_dai, 1); -} - -static int ak4118_i2c_remove(struct i2c_client *i2c) -{ - snd_soc_unregister_component(&i2c->dev); - return 0; + return devm_snd_soc_register_component(&i2c->dev, + &soc_component_drv_ak4118, &ak4118_dai, 1); }
static const struct of_device_id ak4118_of_match[] = { @@ -429,7 +423,6 @@ static struct i2c_driver ak4118_i2c_driver = { }, .id_table = ak4118_id_table, .probe = ak4118_i2c_probe, - .remove = ak4118_i2c_remove, };
module_i2c_driver(ak4118_i2c_driver);
![](https://secure.gravatar.com/avatar/2ea1ea42072986bc3dd023464d0c2de6.jpg?s=120&d=mm&r=g)
From: Kuninori Morimoto kuninori.morimoto.gx@renesas.com
We have devm_xxx version of snd_soc_register_component, let's use it.
Signed-off-by: Kuninori Morimoto kuninori.morimoto.gx@renesas.com --- v1 -> v2
- no change
sound/soc/codecs/cros_ec_codec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/soc/codecs/cros_ec_codec.c b/sound/soc/codecs/cros_ec_codec.c index 99a3af8..0ac3e52 100644 --- a/sound/soc/codecs/cros_ec_codec.c +++ b/sound/soc/codecs/cros_ec_codec.c @@ -413,7 +413,7 @@ static int cros_ec_codec_platform_probe(struct platform_device *pd)
platform_set_drvdata(pd, codec_data);
- return snd_soc_register_component(dev, &cros_ec_component_driver, + return devm_snd_soc_register_component(dev, &cros_ec_component_driver, cros_ec_dai, ARRAY_SIZE(cros_ec_dai)); }
![](https://secure.gravatar.com/avatar/d930951cb00393ecf9c3db3a56d78fa9.jpg?s=120&d=mm&r=g)
The patch
ASoC: cros_ec_codec: use devm_snd_soc_register_component()
has been applied to the asoc tree at
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-5.3
All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying to this mail.
Thanks, Mark
From dcbe6ed32e06b7811e082806a9c0f84d3a238d18 Mon Sep 17 00:00:00 2001
From: Kuninori Morimoto kuninori.morimoto.gx@renesas.com Date: Fri, 28 Jun 2019 13:09:50 +0900 Subject: [PATCH] ASoC: cros_ec_codec: use devm_snd_soc_register_component()
We have devm_xxx version of snd_soc_register_component, let's use it.
Signed-off-by: Kuninori Morimoto kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown broonie@kernel.org --- sound/soc/codecs/cros_ec_codec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/soc/codecs/cros_ec_codec.c b/sound/soc/codecs/cros_ec_codec.c index 99a3af8a15ff..0ac3e520653f 100644 --- a/sound/soc/codecs/cros_ec_codec.c +++ b/sound/soc/codecs/cros_ec_codec.c @@ -413,7 +413,7 @@ static int cros_ec_codec_platform_probe(struct platform_device *pd)
platform_set_drvdata(pd, codec_data);
- return snd_soc_register_component(dev, &cros_ec_component_driver, + return devm_snd_soc_register_component(dev, &cros_ec_component_driver, cros_ec_dai, ARRAY_SIZE(cros_ec_dai)); }
![](https://secure.gravatar.com/avatar/2ea1ea42072986bc3dd023464d0c2de6.jpg?s=120&d=mm&r=g)
From: Kuninori Morimoto kuninori.morimoto.gx@renesas.com
We have devm_xxx version of snd_soc_register_component, let's use it.
Signed-off-by: Kuninori Morimoto kuninori.morimoto.gx@renesas.com --- v1 -> v2
- no change
sound/soc/fsl/imx-ssi.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/sound/soc/fsl/imx-ssi.c b/sound/soc/fsl/imx-ssi.c index 9038b61..24b2908 100644 --- a/sound/soc/fsl/imx-ssi.c +++ b/sound/soc/fsl/imx-ssi.c @@ -586,7 +586,7 @@ static int imx_ssi_probe(struct platform_device *pdev) goto failed_register; }
- ret = snd_soc_register_component(&pdev->dev, &imx_component, + ret = devm_snd_soc_register_component(&pdev->dev, &imx_component, dai, 1); if (ret) { dev_err(&pdev->dev, "register DAI failed\n"); @@ -603,13 +603,11 @@ static int imx_ssi_probe(struct platform_device *pdev)
if (ssi->fiq_init && ssi->dma_init) { ret = ssi->fiq_init; - goto failed_pcm; + goto failed_register; }
return 0;
-failed_pcm: - snd_soc_unregister_component(&pdev->dev); failed_register: clk_disable_unprepare(ssi->clk); failed_clk: @@ -625,8 +623,6 @@ static int imx_ssi_remove(struct platform_device *pdev) if (!ssi->fiq_init) imx_pcm_fiq_exit(pdev);
- snd_soc_unregister_component(&pdev->dev); - if (ssi->flags & IMX_SSI_USE_AC97) ac97_ssi = NULL;
![](https://secure.gravatar.com/avatar/2ea1ea42072986bc3dd023464d0c2de6.jpg?s=120&d=mm&r=g)
From: Kuninori Morimoto kuninori.morimoto.gx@renesas.com
We have devm_xxx version of snd_soc_register_component, let's use it.
Signed-off-by: Kuninori Morimoto kuninori.morimoto.gx@renesas.com --- v1 -> v2
- no change
sound/soc/fsl/mpc5200_psc_i2s.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/sound/soc/fsl/mpc5200_psc_i2s.c b/sound/soc/fsl/mpc5200_psc_i2s.c index 9bc01f3..80902a2 100644 --- a/sound/soc/fsl/mpc5200_psc_i2s.c +++ b/sound/soc/fsl/mpc5200_psc_i2s.c @@ -166,7 +166,7 @@ static int psc_i2s_of_probe(struct platform_device *op) if (rc != 0) return rc;
- rc = snd_soc_register_component(&op->dev, &psc_i2s_component, + rc = devm_snd_soc_register_component(&op->dev, &psc_i2s_component, psc_i2s_dai, ARRAY_SIZE(psc_i2s_dai)); if (rc != 0) { pr_err("Failed to register DAI\n"); @@ -212,7 +212,6 @@ static int psc_i2s_of_probe(struct platform_device *op) static int psc_i2s_of_remove(struct platform_device *op) { mpc5200_audio_dma_destroy(op); - snd_soc_unregister_component(&op->dev); return 0; }
![](https://secure.gravatar.com/avatar/2ea1ea42072986bc3dd023464d0c2de6.jpg?s=120&d=mm&r=g)
From: Kuninori Morimoto kuninori.morimoto.gx@renesas.com
We have devm_xxx version of snd_soc_register_component, let's use it.
Signed-off-by: Kuninori Morimoto kuninori.morimoto.gx@renesas.com --- v1 -> v2
- no change
sound/soc/fsl/mpc5200_psc_ac97.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/sound/soc/fsl/mpc5200_psc_ac97.c b/sound/soc/fsl/mpc5200_psc_ac97.c index e5b9c04d..4a86e6c 100644 --- a/sound/soc/fsl/mpc5200_psc_ac97.c +++ b/sound/soc/fsl/mpc5200_psc_ac97.c @@ -290,7 +290,7 @@ static int psc_ac97_of_probe(struct platform_device *op) return rc; }
- rc = snd_soc_register_component(&op->dev, &psc_ac97_component, + rc = devm_snd_soc_register_component(&op->dev, &psc_ac97_component, psc_ac97_dai, ARRAY_SIZE(psc_ac97_dai)); if (rc != 0) { dev_err(&op->dev, "Failed to register DAI\n"); @@ -316,7 +316,6 @@ static int psc_ac97_of_probe(struct platform_device *op) static int psc_ac97_of_remove(struct platform_device *op) { mpc5200_audio_dma_destroy(op); - snd_soc_unregister_component(&op->dev); snd_soc_set_ac97_ops(NULL); return 0; }
![](https://secure.gravatar.com/avatar/2ea1ea42072986bc3dd023464d0c2de6.jpg?s=120&d=mm&r=g)
From: Kuninori Morimoto kuninori.morimoto.gx@renesas.com
We have devm_xxx version of snd_soc_register_component, let's use it.
Signed-off-by: Kuninori Morimoto kuninori.morimoto.gx@renesas.com --- v1 -> v2
- no change
sound/soc/pxa/pxa2xx-ac97.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/sound/soc/pxa/pxa2xx-ac97.c b/sound/soc/pxa/pxa2xx-ac97.c index 687a8f1f..bf28187 100644 --- a/sound/soc/pxa/pxa2xx-ac97.c +++ b/sound/soc/pxa/pxa2xx-ac97.c @@ -250,7 +250,7 @@ static int pxa2xx_ac97_dev_probe(struct platform_device *pdev) * driver to do interesting things with the clocking to get us up * and running. */ - return snd_soc_register_component(&pdev->dev, &pxa_ac97_component, + return devm_snd_soc_register_component(&pdev->dev, &pxa_ac97_component, pxa_ac97_dai_driver, ARRAY_SIZE(pxa_ac97_dai_driver)); }
@@ -258,7 +258,6 @@ static int pxa2xx_ac97_dev_remove(struct platform_device *pdev) { struct ac97_controller *ctrl = platform_get_drvdata(pdev);
- snd_soc_unregister_component(&pdev->dev); snd_ac97_controller_unregister(ctrl); pxa2xx_ac97_hw_remove(pdev); return 0;
![](https://secure.gravatar.com/avatar/d930951cb00393ecf9c3db3a56d78fa9.jpg?s=120&d=mm&r=g)
The patch
ASoC: pxa: pxa2xx-ac97.c: use devm_snd_soc_register_component()
has been applied to the asoc tree at
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-5.3
All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying to this mail.
Thanks, Mark
From 4b9b73b86571e8a03fb09232ff72177e66bf9ef9 Mon Sep 17 00:00:00 2001
From: Kuninori Morimoto kuninori.morimoto.gx@renesas.com Date: Fri, 28 Jun 2019 13:10:31 +0900 Subject: [PATCH] ASoC: pxa: pxa2xx-ac97.c: use devm_snd_soc_register_component()
We have devm_xxx version of snd_soc_register_component, let's use it.
Signed-off-by: Kuninori Morimoto kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown broonie@kernel.org --- sound/soc/pxa/pxa2xx-ac97.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/sound/soc/pxa/pxa2xx-ac97.c b/sound/soc/pxa/pxa2xx-ac97.c index 687a8f1f9e0d..bf28187315db 100644 --- a/sound/soc/pxa/pxa2xx-ac97.c +++ b/sound/soc/pxa/pxa2xx-ac97.c @@ -250,7 +250,7 @@ static int pxa2xx_ac97_dev_probe(struct platform_device *pdev) * driver to do interesting things with the clocking to get us up * and running. */ - return snd_soc_register_component(&pdev->dev, &pxa_ac97_component, + return devm_snd_soc_register_component(&pdev->dev, &pxa_ac97_component, pxa_ac97_dai_driver, ARRAY_SIZE(pxa_ac97_dai_driver)); }
@@ -258,7 +258,6 @@ static int pxa2xx_ac97_dev_remove(struct platform_device *pdev) { struct ac97_controller *ctrl = platform_get_drvdata(pdev);
- snd_soc_unregister_component(&pdev->dev); snd_ac97_controller_unregister(ctrl); pxa2xx_ac97_hw_remove(pdev); return 0;
![](https://secure.gravatar.com/avatar/2ea1ea42072986bc3dd023464d0c2de6.jpg?s=120&d=mm&r=g)
From: Kuninori Morimoto kuninori.morimoto.gx@renesas.com
We have devm_xxx version of snd_soc_register_component, let's use it.
Signed-off-by: Kuninori Morimoto kuninori.morimoto.gx@renesas.com --- v1 -> v2
- no change
sound/soc/tegra/tegra20_i2s.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-)
diff --git a/sound/soc/tegra/tegra20_i2s.c b/sound/soc/tegra/tegra20_i2s.c index fd94911..14f55ca 100644 --- a/sound/soc/tegra/tegra20_i2s.c +++ b/sound/soc/tegra/tegra20_i2s.c @@ -376,8 +376,8 @@ static int tegra20_i2s_platform_probe(struct platform_device *pdev) goto err_pm_disable; }
- ret = snd_soc_register_component(&pdev->dev, &tegra20_i2s_component, - &i2s->dai, 1); + ret = devm_snd_soc_register_component(&pdev->dev, + &tegra20_i2s_component, &i2s->dai, 1); if (ret) { dev_err(&pdev->dev, "Could not register DAI: %d\n", ret); ret = -ENOMEM; @@ -387,13 +387,11 @@ static int tegra20_i2s_platform_probe(struct platform_device *pdev) ret = tegra_pcm_platform_register(&pdev->dev); if (ret) { dev_err(&pdev->dev, "Could not register PCM: %d\n", ret); - goto err_unregister_component; + goto err_suspend; }
return 0;
-err_unregister_component: - snd_soc_unregister_component(&pdev->dev); err_suspend: if (!pm_runtime_status_suspended(&pdev->dev)) tegra20_i2s_runtime_suspend(&pdev->dev); @@ -413,8 +411,6 @@ static int tegra20_i2s_platform_remove(struct platform_device *pdev) if (!pm_runtime_status_suspended(&pdev->dev)) tegra20_i2s_runtime_suspend(&pdev->dev);
- snd_soc_unregister_component(&pdev->dev); - clk_put(i2s->clk_i2s);
return 0;
![](https://secure.gravatar.com/avatar/d930951cb00393ecf9c3db3a56d78fa9.jpg?s=120&d=mm&r=g)
On Fri, Jun 28, 2019 at 01:10:40PM +0900, Kuninori Morimoto wrote:
if (!pm_runtime_status_suspended(&pdev->dev)) tegra20_i2s_runtime_suspend(&pdev->dev);
- snd_soc_unregister_component(&pdev->dev);
- clk_put(i2s->clk_i2s);
Same thing with clk_get() here and for some of the others.
![](https://secure.gravatar.com/avatar/2ea1ea42072986bc3dd023464d0c2de6.jpg?s=120&d=mm&r=g)
From: Kuninori Morimoto kuninori.morimoto.gx@renesas.com
We have devm_xxx version of snd_soc_register_component, let's use it.
Signed-off-by: Kuninori Morimoto kuninori.morimoto.gx@renesas.com --- v1 -> v2
- no change
sound/soc/tegra/tegra20_spdif.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-)
diff --git a/sound/soc/tegra/tegra20_spdif.c b/sound/soc/tegra/tegra20_spdif.c index cde526d..b1d4890 100644 --- a/sound/soc/tegra/tegra20_spdif.c +++ b/sound/soc/tegra/tegra20_spdif.c @@ -300,8 +300,9 @@ static int tegra20_spdif_platform_probe(struct platform_device *pdev) goto err_pm_disable; }
- ret = snd_soc_register_component(&pdev->dev, &tegra20_spdif_component, - &tegra20_spdif_dai, 1); + ret = devm_snd_soc_register_component(&pdev->dev, + &tegra20_spdif_component, + &tegra20_spdif_dai, 1); if (ret) { dev_err(&pdev->dev, "Could not register DAI: %d\n", ret); ret = -ENOMEM; @@ -311,13 +312,11 @@ static int tegra20_spdif_platform_probe(struct platform_device *pdev) ret = tegra_pcm_platform_register(&pdev->dev); if (ret) { dev_err(&pdev->dev, "Could not register PCM: %d\n", ret); - goto err_unregister_component; + goto err_suspend; }
return 0;
-err_unregister_component: - snd_soc_unregister_component(&pdev->dev); err_suspend: if (!pm_runtime_status_suspended(&pdev->dev)) tegra20_spdif_runtime_suspend(&pdev->dev); @@ -333,8 +332,6 @@ static int tegra20_spdif_platform_remove(struct platform_device *pdev) if (!pm_runtime_status_suspended(&pdev->dev)) tegra20_spdif_runtime_suspend(&pdev->dev);
- snd_soc_unregister_component(&pdev->dev); - return 0; }
![](https://secure.gravatar.com/avatar/2ea1ea42072986bc3dd023464d0c2de6.jpg?s=120&d=mm&r=g)
From: Kuninori Morimoto kuninori.morimoto.gx@renesas.com
We have devm_xxx version of snd_soc_register_component, let's use it.
Signed-off-by: Kuninori Morimoto kuninori.morimoto.gx@renesas.com --- v1 -> v2
- no change
sound/soc/tegra/tegra20_ac97.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-)
diff --git a/sound/soc/tegra/tegra20_ac97.c b/sound/soc/tegra/tegra20_ac97.c index 7c359c4..ae94db4 100644 --- a/sound/soc/tegra/tegra20_ac97.c +++ b/sound/soc/tegra/tegra20_ac97.c @@ -377,8 +377,8 @@ static int tegra20_ac97_platform_probe(struct platform_device *pdev) goto err_clk_disable_unprepare; }
- ret = snd_soc_register_component(&pdev->dev, &tegra20_ac97_component, - &tegra20_ac97_dai, 1); + ret = devm_snd_soc_register_component(&pdev->dev, + &tegra20_ac97_component, &tegra20_ac97_dai, 1); if (ret) { dev_err(&pdev->dev, "Could not register DAI: %d\n", ret); ret = -ENOMEM; @@ -388,7 +388,7 @@ static int tegra20_ac97_platform_probe(struct platform_device *pdev) ret = tegra_pcm_platform_register(&pdev->dev); if (ret) { dev_err(&pdev->dev, "Could not register PCM: %d\n", ret); - goto err_unregister_component; + goto err_clk_disable_unprepare; }
/* XXX: crufty ASoC AC97 API - only one AC97 codec allowed */ @@ -396,8 +396,6 @@ static int tegra20_ac97_platform_probe(struct platform_device *pdev)
return 0;
-err_unregister_component: - snd_soc_unregister_component(&pdev->dev); err_clk_disable_unprepare: clk_disable_unprepare(ac97->clk_ac97); err_clk_put: @@ -410,8 +408,6 @@ static int tegra20_ac97_platform_remove(struct platform_device *pdev) { struct tegra20_ac97 *ac97 = dev_get_drvdata(&pdev->dev);
- snd_soc_unregister_component(&pdev->dev); - clk_disable_unprepare(ac97->clk_ac97);
snd_soc_set_ac97_ops(NULL);
![](https://secure.gravatar.com/avatar/2ea1ea42072986bc3dd023464d0c2de6.jpg?s=120&d=mm&r=g)
From: Kuninori Morimoto kuninori.morimoto.gx@renesas.com
We have devm_xxx version of snd_soc_register_component, let's use it.
Signed-off-by: Kuninori Morimoto kuninori.morimoto.gx@renesas.com --- v1 -> v2
- no change
sound/soc/tegra/tegra30_i2s.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-)
diff --git a/sound/soc/tegra/tegra30_i2s.c b/sound/soc/tegra/tegra30_i2s.c index 2f70bf0..7d9e1e4 100644 --- a/sound/soc/tegra/tegra30_i2s.c +++ b/sound/soc/tegra/tegra30_i2s.c @@ -463,8 +463,8 @@ static int tegra30_i2s_platform_probe(struct platform_device *pdev) goto err_free_rx_fifo; }
- ret = snd_soc_register_component(&pdev->dev, &tegra30_i2s_component, - &i2s->dai, 1); + ret = devm_snd_soc_register_component(&pdev->dev, + &tegra30_i2s_component, &i2s->dai, 1); if (ret) { dev_err(&pdev->dev, "Could not register DAI: %d\n", ret); ret = -ENOMEM; @@ -476,13 +476,11 @@ static int tegra30_i2s_platform_probe(struct platform_device *pdev) i2s->capture_dma_chan); if (ret) { dev_err(&pdev->dev, "Could not register PCM: %d\n", ret); - goto err_unregister_component; + goto err_unroute_rx_fifo; }
return 0;
-err_unregister_component: - snd_soc_unregister_component(&pdev->dev); err_unroute_rx_fifo: tegra30_ahub_unset_rx_cif_source(i2s->capture_fifo_cif); err_free_rx_fifo: @@ -510,8 +508,6 @@ static int tegra30_i2s_platform_remove(struct platform_device *pdev) if (!pm_runtime_status_suspended(&pdev->dev)) tegra30_i2s_runtime_suspend(&pdev->dev);
- snd_soc_unregister_component(&pdev->dev); - tegra30_ahub_unset_rx_cif_source(i2s->capture_fifo_cif); tegra30_ahub_free_rx_fifo(i2s->capture_fifo_cif);
![](https://secure.gravatar.com/avatar/2ea1ea42072986bc3dd023464d0c2de6.jpg?s=120&d=mm&r=g)
From: Kuninori Morimoto kuninori.morimoto.gx@renesas.com
We have devm_xxx version of snd_soc_register_component, let's use it.
Signed-off-by: Kuninori Morimoto kuninori.morimoto.gx@renesas.com --- v1 -> v2
- no change
sound/soc/ti/davinci-i2s.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/sound/soc/ti/davinci-i2s.c b/sound/soc/ti/davinci-i2s.c index 92c1bdc..67b8538 100644 --- a/sound/soc/ti/davinci-i2s.c +++ b/sound/soc/ti/davinci-i2s.c @@ -723,7 +723,7 @@ static int davinci_i2s_probe(struct platform_device *pdev) dev->dev = &pdev->dev; dev_set_drvdata(&pdev->dev, dev);
- ret = snd_soc_register_component(&pdev->dev, &davinci_i2s_component, + ret = devm_snd_soc_register_component(&pdev->dev, &davinci_i2s_component, &davinci_i2s_dai, 1); if (ret != 0) goto err_release_clk; @@ -731,13 +731,11 @@ static int davinci_i2s_probe(struct platform_device *pdev) ret = edma_pcm_platform_register(&pdev->dev); if (ret) { dev_err(&pdev->dev, "register PCM failed: %d\n", ret); - goto err_unregister_component; + goto err_release_clk; }
return 0;
-err_unregister_component: - snd_soc_unregister_component(&pdev->dev); err_release_clk: clk_disable(dev->clk); clk_put(dev->clk); @@ -748,8 +746,6 @@ static int davinci_i2s_remove(struct platform_device *pdev) { struct davinci_mcbsp_dev *dev = dev_get_drvdata(&pdev->dev);
- snd_soc_unregister_component(&pdev->dev); - clk_disable(dev->clk); clk_put(dev->clk); dev->clk = NULL;
![](https://secure.gravatar.com/avatar/2ea1ea42072986bc3dd023464d0c2de6.jpg?s=120&d=mm&r=g)
From: Kuninori Morimoto kuninori.morimoto.gx@renesas.com
We have devm_xxx version of snd_soc_register_component, let's use it.
Signed-off-by: Kuninori Morimoto kuninori.morimoto.gx@renesas.com --- v1 -> v2
- no change
sound/soc/ux500/ux500_msp_dai.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-)
diff --git a/sound/soc/ux500/ux500_msp_dai.c b/sound/soc/ux500/ux500_msp_dai.c index 35669b7..131f09e 100644 --- a/sound/soc/ux500/ux500_msp_dai.c +++ b/sound/soc/ux500/ux500_msp_dai.c @@ -800,7 +800,7 @@ static int ux500_msp_drv_probe(struct platform_device *pdev) } dev_set_drvdata(&pdev->dev, drvdata);
- ret = snd_soc_register_component(&pdev->dev, &ux500_msp_component, + ret = devm_snd_soc_register_component(&pdev->dev, &ux500_msp_component, &ux500_msp_dai_drv, 1); if (ret < 0) { dev_err(&pdev->dev, "Error: %s: Failed to register MSP%d!\n", @@ -813,22 +813,16 @@ static int ux500_msp_drv_probe(struct platform_device *pdev) dev_err(&pdev->dev, "Error: %s: Failed to register PCM platform device!\n", __func__); - goto err_reg_plat; + return ret; }
return 0; - -err_reg_plat: - snd_soc_unregister_component(&pdev->dev); - return ret; }
static int ux500_msp_drv_remove(struct platform_device *pdev) { struct ux500_msp_i2s_drvdata *drvdata = dev_get_drvdata(&pdev->dev);
- snd_soc_unregister_component(&pdev->dev); - prcmu_qos_remove_requirement(PRCMU_QOS_APE_OPP, "ux500_msp_i2s");
ux500_msp_i2s_cleanup_msp(pdev, drvdata->msp);
participants (3)
-
Codrin.Ciubotariu@microchip.com
-
Kuninori Morimoto
-
Mark Brown