All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/23] ASoC: use devm_xxx
@ 2019-06-27  1:59 Kuninori Morimoto
  2019-06-27  2:00 ` [PATCH 01/23] ASoC: atmel: atmel-pcm:dma.c: use devm_snd_dmaengine_pcm_register() Kuninori Morimoto
                   ` (22 more replies)
  0 siblings, 23 replies; 34+ messages in thread
From: Kuninori Morimoto @ 2019-06-27  1:59 UTC (permalink / raw)
  To: Mark Brown; +Cc: Linux-ALSA


Hi Mark

We have devm_xxx(), but some drivers are not using it even though normal usecase.
These patches exchange to use it.

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: tegra30_i2s.c: use devm_snd_soc_register_component()
  ASoC: tegra: tegra20_ac97.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  |  4 ++--
 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        |  5 ++---
 sound/soc/codecs/cros_ec_codec.c |  2 +-
 sound/soc/codecs/rt5682.c        |  7 +++----
 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   |  9 +++------
 sound/soc/tegra/tegra20_i2s.c    |  9 +++------
 sound/soc/tegra/tegra20_spdif.c  | 10 ++++------
 sound/soc/tegra/tegra30_i2s.c    |  9 +++------
 sound/soc/tegra/tegra_pcm.c      |  6 +++---
 sound/soc/ti/davinci-i2s.c       |  8 ++------
 sound/soc/ux500/ux500_msp_dai.c  | 10 ++--------
 sound/soc/ux500/ux500_pcm.c      |  3 +--
 23 files changed, 46 insertions(+), 94 deletions(-)

-- 
2.7.4





Thank you for your help !!
Best regards
---
Kuninori Morimoto

^ permalink raw reply	[flat|nested] 34+ messages in thread

* [PATCH 01/23] ASoC: atmel: atmel-pcm:dma.c: use devm_snd_dmaengine_pcm_register()
  2019-06-27  1:59 [PATCH 00/23] ASoC: use devm_xxx Kuninori Morimoto
@ 2019-06-27  2:00 ` Kuninori Morimoto
  2019-06-27  7:43   ` Amadeusz Sławiński
  2019-06-27  2:00 ` [PATCH 02/23] ASoC: sunxi: sun4i-i2s.c: " Kuninori Morimoto
                   ` (21 subsequent siblings)
  22 siblings, 1 reply; 34+ messages in thread
From: Kuninori Morimoto @ 2019-06-27  2:00 UTC (permalink / raw)
  To: Mark Brown; +Cc: Linux-ALSA

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>
---
 sound/soc/atmel/atmel-pcm-dma.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sound/soc/atmel/atmel-pcm-dma.c b/sound/soc/atmel/atmel-pcm-dma.c
index 042e593..9abf072 100644
--- a/sound/soc/atmel/atmel-pcm-dma.c
+++ b/sound/soc/atmel/atmel-pcm-dma.c
@@ -111,13 +111,13 @@ 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);
 
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [PATCH 02/23] ASoC: sunxi: sun4i-i2s.c: use devm_snd_dmaengine_pcm_register()
  2019-06-27  1:59 [PATCH 00/23] ASoC: use devm_xxx Kuninori Morimoto
  2019-06-27  2:00 ` [PATCH 01/23] ASoC: atmel: atmel-pcm:dma.c: use devm_snd_dmaengine_pcm_register() Kuninori Morimoto
@ 2019-06-27  2:00 ` Kuninori Morimoto
  2019-06-27  2:00 ` [PATCH 03/23] ASoC: tegra: tegra_pcm.c: " Kuninori Morimoto
                   ` (20 subsequent siblings)
  22 siblings, 0 replies; 34+ messages in thread
From: Kuninori Morimoto @ 2019-06-27  2:00 UTC (permalink / raw)
  To: Mark Brown; +Cc: Linux-ALSA

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>
---
 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);
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [PATCH 03/23] ASoC: tegra: tegra_pcm.c: use devm_snd_dmaengine_pcm_register()
  2019-06-27  1:59 [PATCH 00/23] ASoC: use devm_xxx Kuninori Morimoto
  2019-06-27  2:00 ` [PATCH 01/23] ASoC: atmel: atmel-pcm:dma.c: use devm_snd_dmaengine_pcm_register() Kuninori Morimoto
  2019-06-27  2:00 ` [PATCH 02/23] ASoC: sunxi: sun4i-i2s.c: " Kuninori Morimoto
@ 2019-06-27  2:00 ` Kuninori Morimoto
  2019-06-27  7:43   ` Amadeusz Sławiński
  2019-06-27  2:00 ` [PATCH 04/23] ASoC: ux500: ux500_pcm.c: " Kuninori Morimoto
                   ` (19 subsequent siblings)
  22 siblings, 1 reply; 34+ messages in thread
From: Kuninori Morimoto @ 2019-06-27  2:00 UTC (permalink / raw)
  To: Mark Brown; +Cc: Linux-ALSA

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>
---
 sound/soc/tegra/tegra_pcm.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/sound/soc/tegra/tegra_pcm.c b/sound/soc/tegra/tegra_pcm.c
index f246df8..1814791 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,13 +58,12 @@ 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);
 
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [PATCH 04/23] ASoC: ux500: ux500_pcm.c: use devm_snd_dmaengine_pcm_register()
  2019-06-27  1:59 [PATCH 00/23] ASoC: use devm_xxx Kuninori Morimoto
                   ` (2 preceding siblings ...)
  2019-06-27  2:00 ` [PATCH 03/23] ASoC: tegra: tegra_pcm.c: " Kuninori Morimoto
@ 2019-06-27  2:00 ` Kuninori Morimoto
  2019-06-27  7:43   ` Amadeusz Sławiński
  2019-06-27  2:00 ` [PATCH 05/23] ASoC: au1x: i2sc.c: use devm_snd_soc_register_component() Kuninori Morimoto
                   ` (18 subsequent siblings)
  22 siblings, 1 reply; 34+ messages in thread
From: Kuninori Morimoto @ 2019-06-27  2:00 UTC (permalink / raw)
  To: Mark Brown; +Cc: Linux-ALSA

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>
---
 sound/soc/ux500/ux500_pcm.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/sound/soc/ux500/ux500_pcm.c b/sound/soc/ux500/ux500_pcm.c
index 9445dbe..05ae02c 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,
@@ -158,7 +158,6 @@ 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);
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [PATCH 05/23] ASoC: au1x: i2sc.c: use devm_snd_soc_register_component()
  2019-06-27  1:59 [PATCH 00/23] ASoC: use devm_xxx Kuninori Morimoto
                   ` (3 preceding siblings ...)
  2019-06-27  2:00 ` [PATCH 04/23] ASoC: ux500: ux500_pcm.c: " Kuninori Morimoto
@ 2019-06-27  2:00 ` Kuninori Morimoto
  2019-06-27  2:00 ` [PATCH 06/23] ASoC: au1x: ac97c.c: " Kuninori Morimoto
                   ` (17 subsequent siblings)
  22 siblings, 0 replies; 34+ messages in thread
From: Kuninori Morimoto @ 2019-06-27  2:00 UTC (permalink / raw)
  To: Mark Brown; +Cc: Linux-ALSA

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>
---
 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;
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [PATCH 06/23] ASoC: au1x: ac97c.c: use devm_snd_soc_register_component()
  2019-06-27  1:59 [PATCH 00/23] ASoC: use devm_xxx Kuninori Morimoto
                   ` (4 preceding siblings ...)
  2019-06-27  2:00 ` [PATCH 05/23] ASoC: au1x: i2sc.c: use devm_snd_soc_register_component() Kuninori Morimoto
@ 2019-06-27  2:00 ` Kuninori Morimoto
  2019-06-27  2:00 ` [PATCH 07/23] ASoC: au1x: psc-ac97.c: " Kuninori Morimoto
                   ` (16 subsequent siblings)
  22 siblings, 0 replies; 34+ messages in thread
From: Kuninori Morimoto @ 2019-06-27  2:00 UTC (permalink / raw)
  To: Mark Brown; +Cc: Linux-ALSA

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>
---
 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 */
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [PATCH 07/23] ASoC: au1x: psc-ac97.c: use devm_snd_soc_register_component()
  2019-06-27  1:59 [PATCH 00/23] ASoC: use devm_xxx Kuninori Morimoto
                   ` (5 preceding siblings ...)
  2019-06-27  2:00 ` [PATCH 06/23] ASoC: au1x: ac97c.c: " Kuninori Morimoto
@ 2019-06-27  2:00 ` Kuninori Morimoto
  2019-06-27  2:00 ` [PATCH 08/23] ASoC: au1x: psc-i2s.c: " Kuninori Morimoto
                   ` (15 subsequent siblings)
  22 siblings, 0 replies; 34+ messages in thread
From: Kuninori Morimoto @ 2019-06-27  2:00 UTC (permalink / raw)
  To: Mark Brown; +Cc: Linux-ALSA

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>
---
 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 */
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [PATCH 08/23] ASoC: au1x: psc-i2s.c: use devm_snd_soc_register_component()
  2019-06-27  1:59 [PATCH 00/23] ASoC: use devm_xxx Kuninori Morimoto
                   ` (6 preceding siblings ...)
  2019-06-27  2:00 ` [PATCH 07/23] ASoC: au1x: psc-ac97.c: " Kuninori Morimoto
@ 2019-06-27  2:00 ` Kuninori Morimoto
  2019-06-27  2:00 ` [PATCH 09/23] ASoC: cirrus: ep93xx-i2s.c: " Kuninori Morimoto
                   ` (14 subsequent siblings)
  22 siblings, 0 replies; 34+ messages in thread
From: Kuninori Morimoto @ 2019-06-27  2:00 UTC (permalink / raw)
  To: Mark Brown; +Cc: Linux-ALSA

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>
---
 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));
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [PATCH 09/23] ASoC: cirrus: ep93xx-i2s.c: use devm_snd_soc_register_component()
  2019-06-27  1:59 [PATCH 00/23] ASoC: use devm_xxx Kuninori Morimoto
                   ` (7 preceding siblings ...)
  2019-06-27  2:00 ` [PATCH 08/23] ASoC: au1x: psc-i2s.c: " Kuninori Morimoto
@ 2019-06-27  2:00 ` Kuninori Morimoto
  2019-06-27  2:00 ` [PATCH 10/23] ASoC: cirrus: ep93xx-ac97.c: " Kuninori Morimoto
                   ` (13 subsequent siblings)
  22 siblings, 0 replies; 34+ messages in thread
From: Kuninori Morimoto @ 2019-06-27  2:00 UTC (permalink / raw)
  To: Mark Brown; +Cc: Linux-ALSA

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>
---
 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);
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [PATCH 10/23] ASoC: cirrus: ep93xx-ac97.c: use devm_snd_soc_register_component()
  2019-06-27  1:59 [PATCH 00/23] ASoC: use devm_xxx Kuninori Morimoto
                   ` (8 preceding siblings ...)
  2019-06-27  2:00 ` [PATCH 09/23] ASoC: cirrus: ep93xx-i2s.c: " Kuninori Morimoto
@ 2019-06-27  2:00 ` Kuninori Morimoto
  2019-06-27  2:00 ` [PATCH 11/23] ASoC: rt5682: " Kuninori Morimoto
                   ` (12 subsequent siblings)
  22 siblings, 0 replies; 34+ messages in thread
From: Kuninori Morimoto @ 2019-06-27  2:00 UTC (permalink / raw)
  To: Mark Brown; +Cc: Linux-ALSA

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>
---
 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);
 
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [PATCH 11/23] ASoC: rt5682: use devm_snd_soc_register_component()
  2019-06-27  1:59 [PATCH 00/23] ASoC: use devm_xxx Kuninori Morimoto
                   ` (9 preceding siblings ...)
  2019-06-27  2:00 ` [PATCH 10/23] ASoC: cirrus: ep93xx-ac97.c: " Kuninori Morimoto
@ 2019-06-27  2:00 ` Kuninori Morimoto
  2019-06-27  7:43   ` Amadeusz Sławiński
  2019-06-27  2:00 ` [PATCH 12/23] ASoC: ak4118: " Kuninori Morimoto
                   ` (11 subsequent siblings)
  22 siblings, 1 reply; 34+ messages in thread
From: Kuninori Morimoto @ 2019-06-27  2:00 UTC (permalink / raw)
  To: Mark Brown; +Cc: Linux-ALSA


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>
---
 sound/soc/codecs/rt5682.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/sound/soc/codecs/rt5682.c b/sound/soc/codecs/rt5682.c
index 78409dd..a3459ce 100644
--- a/sound/soc/codecs/rt5682.c
+++ b/sound/soc/codecs/rt5682.c
@@ -2662,14 +2662,13 @@ 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));
+	return devm_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;
 }
 
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [PATCH 12/23] ASoC: ak4118: use devm_snd_soc_register_component()
  2019-06-27  1:59 [PATCH 00/23] ASoC: use devm_xxx Kuninori Morimoto
                   ` (10 preceding siblings ...)
  2019-06-27  2:00 ` [PATCH 11/23] ASoC: rt5682: " Kuninori Morimoto
@ 2019-06-27  2:00 ` Kuninori Morimoto
  2019-06-27  7:43   ` Amadeusz Sławiński
  2019-06-27  2:00 ` [PATCH 13/23] ASoC: cros_ec_codec: " Kuninori Morimoto
                   ` (10 subsequent siblings)
  22 siblings, 1 reply; 34+ messages in thread
From: Kuninori Morimoto @ 2019-06-27  2:00 UTC (permalink / raw)
  To: Mark Brown; +Cc: Linux-ALSA


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>
---
 sound/soc/codecs/ak4118.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/sound/soc/codecs/ak4118.c b/sound/soc/codecs/ak4118.c
index ce419e8..efbe2d6 100644
--- a/sound/soc/codecs/ak4118.c
+++ b/sound/soc/codecs/ak4118.c
@@ -400,13 +400,12 @@ 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);
+	return devm_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;
 }
 
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [PATCH 13/23] ASoC: cros_ec_codec: use devm_snd_soc_register_component()
  2019-06-27  1:59 [PATCH 00/23] ASoC: use devm_xxx Kuninori Morimoto
                   ` (11 preceding siblings ...)
  2019-06-27  2:00 ` [PATCH 12/23] ASoC: ak4118: " Kuninori Morimoto
@ 2019-06-27  2:00 ` Kuninori Morimoto
  2019-06-27  2:00 ` [PATCH 14/23] ASoC: fsl: imx-ssi.c: " Kuninori Morimoto
                   ` (9 subsequent siblings)
  22 siblings, 0 replies; 34+ messages in thread
From: Kuninori Morimoto @ 2019-06-27  2:00 UTC (permalink / raw)
  To: Mark Brown; +Cc: Linux-ALSA

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>
---
 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));
 }
 
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [PATCH 14/23] ASoC: fsl: imx-ssi.c: use devm_snd_soc_register_component()
  2019-06-27  1:59 [PATCH 00/23] ASoC: use devm_xxx Kuninori Morimoto
                   ` (12 preceding siblings ...)
  2019-06-27  2:00 ` [PATCH 13/23] ASoC: cros_ec_codec: " Kuninori Morimoto
@ 2019-06-27  2:00 ` Kuninori Morimoto
  2019-06-27  2:01 ` [PATCH 15/23] ASoC: fsl: mpc5200_psc_i2s.c: " Kuninori Morimoto
                   ` (8 subsequent siblings)
  22 siblings, 0 replies; 34+ messages in thread
From: Kuninori Morimoto @ 2019-06-27  2:00 UTC (permalink / raw)
  To: Mark Brown; +Cc: Linux-ALSA

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>
---
 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;
 
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [PATCH 15/23] ASoC: fsl: mpc5200_psc_i2s.c: use devm_snd_soc_register_component()
  2019-06-27  1:59 [PATCH 00/23] ASoC: use devm_xxx Kuninori Morimoto
                   ` (13 preceding siblings ...)
  2019-06-27  2:00 ` [PATCH 14/23] ASoC: fsl: imx-ssi.c: " Kuninori Morimoto
@ 2019-06-27  2:01 ` Kuninori Morimoto
  2019-06-27  2:01 ` [PATCH 16/23] ASoC: fsl: mpc5200_psc_ac97.c: " Kuninori Morimoto
                   ` (7 subsequent siblings)
  22 siblings, 0 replies; 34+ messages in thread
From: Kuninori Morimoto @ 2019-06-27  2:01 UTC (permalink / raw)
  To: Mark Brown; +Cc: Linux-ALSA

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>
---
 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;
 }
 
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [PATCH 16/23] ASoC: fsl: mpc5200_psc_ac97.c: use devm_snd_soc_register_component()
  2019-06-27  1:59 [PATCH 00/23] ASoC: use devm_xxx Kuninori Morimoto
                   ` (14 preceding siblings ...)
  2019-06-27  2:01 ` [PATCH 15/23] ASoC: fsl: mpc5200_psc_i2s.c: " Kuninori Morimoto
@ 2019-06-27  2:01 ` Kuninori Morimoto
  2019-06-27  2:01 ` [PATCH 17/23] ASoC: pxa: pxa2xx-ac97.c: " Kuninori Morimoto
                   ` (6 subsequent siblings)
  22 siblings, 0 replies; 34+ messages in thread
From: Kuninori Morimoto @ 2019-06-27  2:01 UTC (permalink / raw)
  To: Mark Brown; +Cc: Linux-ALSA

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>
---
 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;
 }
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [PATCH 17/23] ASoC: pxa: pxa2xx-ac97.c: use devm_snd_soc_register_component()
  2019-06-27  1:59 [PATCH 00/23] ASoC: use devm_xxx Kuninori Morimoto
                   ` (15 preceding siblings ...)
  2019-06-27  2:01 ` [PATCH 16/23] ASoC: fsl: mpc5200_psc_ac97.c: " Kuninori Morimoto
@ 2019-06-27  2:01 ` Kuninori Morimoto
  2019-06-27  2:01 ` [PATCH 18/23] ASoC: tegra: tegra20_i2s.c: " Kuninori Morimoto
                   ` (5 subsequent siblings)
  22 siblings, 0 replies; 34+ messages in thread
From: Kuninori Morimoto @ 2019-06-27  2:01 UTC (permalink / raw)
  To: Mark Brown; +Cc: Linux-ALSA

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>
---
 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;
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [PATCH 18/23] ASoC: tegra: tegra20_i2s.c: use devm_snd_soc_register_component()
  2019-06-27  1:59 [PATCH 00/23] ASoC: use devm_xxx Kuninori Morimoto
                   ` (16 preceding siblings ...)
  2019-06-27  2:01 ` [PATCH 17/23] ASoC: pxa: pxa2xx-ac97.c: " Kuninori Morimoto
@ 2019-06-27  2:01 ` Kuninori Morimoto
  2019-06-27  2:01 ` [PATCH 19/23] ASoC: tegra: tegra20_spdif.c: " Kuninori Morimoto
                   ` (4 subsequent siblings)
  22 siblings, 0 replies; 34+ messages in thread
From: Kuninori Morimoto @ 2019-06-27  2:01 UTC (permalink / raw)
  To: Mark Brown; +Cc: Linux-ALSA

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>
---
 sound/soc/tegra/tegra20_i2s.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/sound/soc/tegra/tegra20_i2s.c b/sound/soc/tegra/tegra20_i2s.c
index 005fc4e6..0dba694 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);
@@ -414,7 +412,6 @@ static int tegra20_i2s_platform_remove(struct platform_device *pdev)
 		tegra20_i2s_runtime_suspend(&pdev->dev);
 
 	tegra_pcm_platform_unregister(&pdev->dev);
-	snd_soc_unregister_component(&pdev->dev);
 
 	clk_put(i2s->clk_i2s);
 
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [PATCH 19/23] ASoC: tegra: tegra20_spdif.c: use devm_snd_soc_register_component()
  2019-06-27  1:59 [PATCH 00/23] ASoC: use devm_xxx Kuninori Morimoto
                   ` (17 preceding siblings ...)
  2019-06-27  2:01 ` [PATCH 18/23] ASoC: tegra: tegra20_i2s.c: " Kuninori Morimoto
@ 2019-06-27  2:01 ` Kuninori Morimoto
  2019-06-27  2:01 ` [PATCH 20/23] ASoC: tegra: tegra30_i2s.c: " Kuninori Morimoto
                   ` (3 subsequent siblings)
  22 siblings, 0 replies; 34+ messages in thread
From: Kuninori Morimoto @ 2019-06-27  2:01 UTC (permalink / raw)
  To: Mark Brown; +Cc: Linux-ALSA

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>
---
 sound/soc/tegra/tegra20_spdif.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/sound/soc/tegra/tegra20_spdif.c b/sound/soc/tegra/tegra20_spdif.c
index 5839833..58a2445 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);
@@ -334,7 +333,6 @@ static int tegra20_spdif_platform_remove(struct platform_device *pdev)
 		tegra20_spdif_runtime_suspend(&pdev->dev);
 
 	tegra_pcm_platform_unregister(&pdev->dev);
-	snd_soc_unregister_component(&pdev->dev);
 
 	return 0;
 }
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [PATCH 20/23] ASoC: tegra: tegra30_i2s.c: use devm_snd_soc_register_component()
  2019-06-27  1:59 [PATCH 00/23] ASoC: use devm_xxx Kuninori Morimoto
                   ` (18 preceding siblings ...)
  2019-06-27  2:01 ` [PATCH 19/23] ASoC: tegra: tegra20_spdif.c: " Kuninori Morimoto
@ 2019-06-27  2:01 ` Kuninori Morimoto
  2019-06-27  2:01 ` [PATCH 21/23] ASoC: tegra: tegra20_ac97.c: " Kuninori Morimoto
                   ` (2 subsequent siblings)
  22 siblings, 0 replies; 34+ messages in thread
From: Kuninori Morimoto @ 2019-06-27  2:01 UTC (permalink / raw)
  To: Mark Brown; +Cc: Linux-ALSA

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>
---
 sound/soc/tegra/tegra30_i2s.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/sound/soc/tegra/tegra30_i2s.c b/sound/soc/tegra/tegra30_i2s.c
index ac6983c..281267a 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:
@@ -511,7 +509,6 @@ static int tegra30_i2s_platform_remove(struct platform_device *pdev)
 		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);
 	tegra30_ahub_free_rx_fifo(i2s->capture_fifo_cif);
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [PATCH 21/23] ASoC: tegra: tegra20_ac97.c: use devm_snd_soc_register_component()
  2019-06-27  1:59 [PATCH 00/23] ASoC: use devm_xxx Kuninori Morimoto
                   ` (19 preceding siblings ...)
  2019-06-27  2:01 ` [PATCH 20/23] ASoC: tegra: tegra30_i2s.c: " Kuninori Morimoto
@ 2019-06-27  2:01 ` Kuninori Morimoto
  2019-06-27  2:01 ` [PATCH 22/23] ASoC: ti: davinci-i2s.c: " Kuninori Morimoto
  2019-06-27  2:01 ` [PATCH 23/23] ASoC: ux500: ux500_msp_dai.c: " Kuninori Morimoto
  22 siblings, 0 replies; 34+ messages in thread
From: Kuninori Morimoto @ 2019-06-27  2:01 UTC (permalink / raw)
  To: Mark Brown; +Cc: Linux-ALSA

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>
---
 sound/soc/tegra/tegra20_ac97.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/sound/soc/tegra/tegra20_ac97.c b/sound/soc/tegra/tegra20_ac97.c
index 09c8516..da71e28 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:
@@ -411,7 +409,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);
 
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [PATCH 22/23] ASoC: ti: davinci-i2s.c: use devm_snd_soc_register_component()
  2019-06-27  1:59 [PATCH 00/23] ASoC: use devm_xxx Kuninori Morimoto
                   ` (20 preceding siblings ...)
  2019-06-27  2:01 ` [PATCH 21/23] ASoC: tegra: tegra20_ac97.c: " Kuninori Morimoto
@ 2019-06-27  2:01 ` Kuninori Morimoto
  2019-06-27  2:01 ` [PATCH 23/23] ASoC: ux500: ux500_msp_dai.c: " Kuninori Morimoto
  22 siblings, 0 replies; 34+ messages in thread
From: Kuninori Morimoto @ 2019-06-27  2:01 UTC (permalink / raw)
  To: Mark Brown; +Cc: Linux-ALSA

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>
---
 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;
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [PATCH 23/23] ASoC: ux500: ux500_msp_dai.c: use devm_snd_soc_register_component()
  2019-06-27  1:59 [PATCH 00/23] ASoC: use devm_xxx Kuninori Morimoto
                   ` (21 preceding siblings ...)
  2019-06-27  2:01 ` [PATCH 22/23] ASoC: ti: davinci-i2s.c: " Kuninori Morimoto
@ 2019-06-27  2:01 ` Kuninori Morimoto
  22 siblings, 0 replies; 34+ messages in thread
From: Kuninori Morimoto @ 2019-06-27  2:01 UTC (permalink / raw)
  To: Mark Brown; +Cc: Linux-ALSA

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>
---
 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 dec065f..17832ca 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,14 +813,10 @@ 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)
@@ -829,8 +825,6 @@ static int ux500_msp_drv_remove(struct platform_device *pdev)
 
 	ux500_pcm_unregister_platform(pdev);
 
-	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);
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 34+ messages in thread

* Re: [PATCH 01/23] ASoC: atmel: atmel-pcm:dma.c: use devm_snd_dmaengine_pcm_register()
  2019-06-27  2:00 ` [PATCH 01/23] ASoC: atmel: atmel-pcm:dma.c: use devm_snd_dmaengine_pcm_register() Kuninori Morimoto
@ 2019-06-27  7:43   ` Amadeusz Sławiński
  2019-06-27  8:20     ` Codrin.Ciubotariu
  0 siblings, 1 reply; 34+ messages in thread
From: Amadeusz Sławiński @ 2019-06-27  7:43 UTC (permalink / raw)
  To: Kuninori Morimoto; +Cc: Linux-ALSA, Mark Brown

On 27 Jun 2019 11:00:01 +0900
Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> wrote:

> 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>
> ---
>  sound/soc/atmel/atmel-pcm-dma.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/sound/soc/atmel/atmel-pcm-dma.c
> b/sound/soc/atmel/atmel-pcm-dma.c index 042e593..9abf072 100644
> --- a/sound/soc/atmel/atmel-pcm-dma.c
> +++ b/sound/soc/atmel/atmel-pcm-dma.c
> @@ -111,13 +111,13 @@ 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);
>  

Do we need to keep empty function?

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH 03/23] ASoC: tegra: tegra_pcm.c: use devm_snd_dmaengine_pcm_register()
  2019-06-27  2:00 ` [PATCH 03/23] ASoC: tegra: tegra_pcm.c: " Kuninori Morimoto
@ 2019-06-27  7:43   ` Amadeusz Sławiński
  0 siblings, 0 replies; 34+ messages in thread
From: Amadeusz Sławiński @ 2019-06-27  7:43 UTC (permalink / raw)
  To: Kuninori Morimoto; +Cc: Linux-ALSA, Mark Brown

On 27 Jun 2019 11:00:10 +0900
Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> wrote:

> 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>
> ---
>  sound/soc/tegra/tegra_pcm.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/sound/soc/tegra/tegra_pcm.c b/sound/soc/tegra/tegra_pcm.c
> index f246df8..1814791 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,13 +58,12 @@ 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);
>  

Again, do we need to keep empty function?

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH 04/23] ASoC: ux500: ux500_pcm.c: use devm_snd_dmaengine_pcm_register()
  2019-06-27  2:00 ` [PATCH 04/23] ASoC: ux500: ux500_pcm.c: " Kuninori Morimoto
@ 2019-06-27  7:43   ` Amadeusz Sławiński
  0 siblings, 0 replies; 34+ messages in thread
From: Amadeusz Sławiński @ 2019-06-27  7:43 UTC (permalink / raw)
  To: Kuninori Morimoto; +Cc: Linux-ALSA, Mark Brown

On 27 Jun 2019 11:00:14 +0900
Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> wrote:

> 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>
> ---
>  sound/soc/ux500/ux500_pcm.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/sound/soc/ux500/ux500_pcm.c b/sound/soc/ux500/ux500_pcm.c
> index 9445dbe..05ae02c 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,
> @@ -158,7 +158,6 @@ 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);

Can also be removed?

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH 11/23] ASoC: rt5682: use devm_snd_soc_register_component()
  2019-06-27  2:00 ` [PATCH 11/23] ASoC: rt5682: " Kuninori Morimoto
@ 2019-06-27  7:43   ` Amadeusz Sławiński
  0 siblings, 0 replies; 34+ messages in thread
From: Amadeusz Sławiński @ 2019-06-27  7:43 UTC (permalink / raw)
  To: Kuninori Morimoto; +Cc: Linux-ALSA, Mark Brown

On 27 Jun 2019 11:00:46 +0900
Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> wrote:

> 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>
> ---
>  sound/soc/codecs/rt5682.c | 7 +++----
>  1 file changed, 3 insertions(+), 4 deletions(-)
> 
> diff --git a/sound/soc/codecs/rt5682.c b/sound/soc/codecs/rt5682.c
> index 78409dd..a3459ce 100644
> --- a/sound/soc/codecs/rt5682.c
> +++ b/sound/soc/codecs/rt5682.c
> @@ -2662,14 +2662,13 @@ 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));
> +	return devm_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;
>  }
>  

Can be entirely removed.

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH 12/23] ASoC: ak4118: use devm_snd_soc_register_component()
  2019-06-27  2:00 ` [PATCH 12/23] ASoC: ak4118: " Kuninori Morimoto
@ 2019-06-27  7:43   ` Amadeusz Sławiński
  2019-06-27  7:51     ` Kuninori Morimoto
  0 siblings, 1 reply; 34+ messages in thread
From: Amadeusz Sławiński @ 2019-06-27  7:43 UTC (permalink / raw)
  To: Kuninori Morimoto; +Cc: Linux-ALSA, Mark Brown

On 27 Jun 2019 11:00:50 +0900
Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> wrote:

> 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>
> ---
>  sound/soc/codecs/ak4118.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/sound/soc/codecs/ak4118.c b/sound/soc/codecs/ak4118.c
> index ce419e8..efbe2d6 100644
> --- a/sound/soc/codecs/ak4118.c
> +++ b/sound/soc/codecs/ak4118.c
> @@ -400,13 +400,12 @@ 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);
> +	return devm_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;
>  }
>  

Remove whole function.

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH 12/23] ASoC: ak4118: use devm_snd_soc_register_component()
  2019-06-27  7:43   ` Amadeusz Sławiński
@ 2019-06-27  7:51     ` Kuninori Morimoto
  0 siblings, 0 replies; 34+ messages in thread
From: Kuninori Morimoto @ 2019-06-27  7:51 UTC (permalink / raw)
  To: Amadeusz Sławiński; +Cc: Linux-ALSA, Mark Brown


Hi Amadeusz

Thank you for your feedback.
This patch is focusing to using devm_xxx().
Removing empty funcion can be other patch series.
But, I can create v2 to remove empty funcion, of course.
I'm very open. Mark what is your opinion ?

> On 27 Jun 2019 11:00:50 +0900
> Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> wrote:
> 
> > 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>
> > ---
> >  sound/soc/codecs/ak4118.c | 5 ++---
> >  1 file changed, 2 insertions(+), 3 deletions(-)
> > 
> > diff --git a/sound/soc/codecs/ak4118.c b/sound/soc/codecs/ak4118.c
> > index ce419e8..efbe2d6 100644
> > --- a/sound/soc/codecs/ak4118.c
> > +++ b/sound/soc/codecs/ak4118.c
> > @@ -400,13 +400,12 @@ 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);
> > +	return devm_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;
> >  }
> >  
> 
> Remove whole function.

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH 01/23] ASoC: atmel: atmel-pcm:dma.c: use devm_snd_dmaengine_pcm_register()
  2019-06-27  7:43   ` Amadeusz Sławiński
@ 2019-06-27  8:20     ` Codrin.Ciubotariu
  2019-06-27  8:24       ` Kuninori Morimoto
  0 siblings, 1 reply; 34+ messages in thread
From: Codrin.Ciubotariu @ 2019-06-27  8:20 UTC (permalink / raw)
  To: amadeuszx.slawinski, kuninori.morimoto.gx; +Cc: alsa-devel, broonie

On 27.06.2019 10:43, Amadeusz Sławiński wrote:
> External E-Mail
> 
> 
> On 27 Jun 2019 11:00:01 +0900
> Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> wrote:
> 
>> 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>
>> ---
>>   sound/soc/atmel/atmel-pcm-dma.c | 4 ++--
>>   1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/sound/soc/atmel/atmel-pcm-dma.c
>> b/sound/soc/atmel/atmel-pcm-dma.c index 042e593..9abf072 100644
>> --- a/sound/soc/atmel/atmel-pcm-dma.c
>> +++ b/sound/soc/atmel/atmel-pcm-dma.c
>> @@ -111,13 +111,13 @@ 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);
>>   
> 
> Do we need to keep empty function?

Most probably not... Kuninori, let me know if you want me to remove 
atmel_pcm_dma_platform_unregister() from everywhere.

Thank you for your patch.

Best regards,
Codrin
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH 01/23] ASoC: atmel: atmel-pcm:dma.c: use devm_snd_dmaengine_pcm_register()
  2019-06-27  8:20     ` Codrin.Ciubotariu
@ 2019-06-27  8:24       ` Kuninori Morimoto
  2019-06-27 11:38         ` Mark Brown
  0 siblings, 1 reply; 34+ messages in thread
From: Kuninori Morimoto @ 2019-06-27  8:24 UTC (permalink / raw)
  To: Codrin.Ciubotariu; +Cc: alsa-devel, broonie, amadeuszx.slawinski


Hi Codrin

Thank you for your feedback

> >> 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>
> >> ---
(snip)
> >>   void atmel_pcm_dma_platform_unregister(struct device *dev)
> >>   {
> >> -	snd_dmaengine_pcm_unregister(dev);
> >>   }
> >>   EXPORT_SYMBOL(atmel_pcm_dma_platform_unregister);
> >>   
> > 
> > Do we need to keep empty function?
> 
> Most probably not... Kuninori, let me know if you want me to remove 
> atmel_pcm_dma_platform_unregister() from everywhere.

I'm asking it to Mark now.
pattern1 is I will post v2 which cares empty function.
pattern2 is I will post "remove empty function" patch set.

Anyway, thank you for your help !!

Thank you for your help !!
Best regards
---
Kuninori Morimoto

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH 01/23] ASoC: atmel: atmel-pcm:dma.c: use devm_snd_dmaengine_pcm_register()
  2019-06-27  8:24       ` Kuninori Morimoto
@ 2019-06-27 11:38         ` Mark Brown
  2019-06-28  1:53           ` Kuninori Morimoto
  0 siblings, 1 reply; 34+ messages in thread
From: Mark Brown @ 2019-06-27 11:38 UTC (permalink / raw)
  To: Kuninori Morimoto; +Cc: Codrin.Ciubotariu, alsa-devel, amadeuszx.slawinski


[-- Attachment #1.1: Type: text/plain, Size: 275 bytes --]

On Thu, Jun 27, 2019 at 05:24:37PM +0900, Kuninori Morimoto wrote:

> I'm asking it to Mark now.
> pattern1 is I will post v2 which cares empty function.
> pattern2 is I will post "remove empty function" patch set.

Removing the empty functions immediately is probably best.

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH 01/23] ASoC: atmel: atmel-pcm:dma.c: use devm_snd_dmaengine_pcm_register()
  2019-06-27 11:38         ` Mark Brown
@ 2019-06-28  1:53           ` Kuninori Morimoto
  0 siblings, 0 replies; 34+ messages in thread
From: Kuninori Morimoto @ 2019-06-28  1:53 UTC (permalink / raw)
  To: Mark Brown; +Cc: Codrin.Ciubotariu, alsa-devel, amadeuszx.slawinski


Hi Mark

> > I'm asking it to Mark now.
> > pattern1 is I will post v2 which cares empty function.
> > pattern2 is I will post "remove empty function" patch set.
> 
> Removing the empty functions immediately is probably best.

OK, I will post v2

Thank you for your help !!
Best regards
---
Kuninori Morimoto

^ permalink raw reply	[flat|nested] 34+ messages in thread

end of thread, other threads:[~2019-06-28  1:54 UTC | newest]

Thread overview: 34+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-27  1:59 [PATCH 00/23] ASoC: use devm_xxx Kuninori Morimoto
2019-06-27  2:00 ` [PATCH 01/23] ASoC: atmel: atmel-pcm:dma.c: use devm_snd_dmaengine_pcm_register() Kuninori Morimoto
2019-06-27  7:43   ` Amadeusz Sławiński
2019-06-27  8:20     ` Codrin.Ciubotariu
2019-06-27  8:24       ` Kuninori Morimoto
2019-06-27 11:38         ` Mark Brown
2019-06-28  1:53           ` Kuninori Morimoto
2019-06-27  2:00 ` [PATCH 02/23] ASoC: sunxi: sun4i-i2s.c: " Kuninori Morimoto
2019-06-27  2:00 ` [PATCH 03/23] ASoC: tegra: tegra_pcm.c: " Kuninori Morimoto
2019-06-27  7:43   ` Amadeusz Sławiński
2019-06-27  2:00 ` [PATCH 04/23] ASoC: ux500: ux500_pcm.c: " Kuninori Morimoto
2019-06-27  7:43   ` Amadeusz Sławiński
2019-06-27  2:00 ` [PATCH 05/23] ASoC: au1x: i2sc.c: use devm_snd_soc_register_component() Kuninori Morimoto
2019-06-27  2:00 ` [PATCH 06/23] ASoC: au1x: ac97c.c: " Kuninori Morimoto
2019-06-27  2:00 ` [PATCH 07/23] ASoC: au1x: psc-ac97.c: " Kuninori Morimoto
2019-06-27  2:00 ` [PATCH 08/23] ASoC: au1x: psc-i2s.c: " Kuninori Morimoto
2019-06-27  2:00 ` [PATCH 09/23] ASoC: cirrus: ep93xx-i2s.c: " Kuninori Morimoto
2019-06-27  2:00 ` [PATCH 10/23] ASoC: cirrus: ep93xx-ac97.c: " Kuninori Morimoto
2019-06-27  2:00 ` [PATCH 11/23] ASoC: rt5682: " Kuninori Morimoto
2019-06-27  7:43   ` Amadeusz Sławiński
2019-06-27  2:00 ` [PATCH 12/23] ASoC: ak4118: " Kuninori Morimoto
2019-06-27  7:43   ` Amadeusz Sławiński
2019-06-27  7:51     ` Kuninori Morimoto
2019-06-27  2:00 ` [PATCH 13/23] ASoC: cros_ec_codec: " Kuninori Morimoto
2019-06-27  2:00 ` [PATCH 14/23] ASoC: fsl: imx-ssi.c: " Kuninori Morimoto
2019-06-27  2:01 ` [PATCH 15/23] ASoC: fsl: mpc5200_psc_i2s.c: " Kuninori Morimoto
2019-06-27  2:01 ` [PATCH 16/23] ASoC: fsl: mpc5200_psc_ac97.c: " Kuninori Morimoto
2019-06-27  2:01 ` [PATCH 17/23] ASoC: pxa: pxa2xx-ac97.c: " Kuninori Morimoto
2019-06-27  2:01 ` [PATCH 18/23] ASoC: tegra: tegra20_i2s.c: " Kuninori Morimoto
2019-06-27  2:01 ` [PATCH 19/23] ASoC: tegra: tegra20_spdif.c: " Kuninori Morimoto
2019-06-27  2:01 ` [PATCH 20/23] ASoC: tegra: tegra30_i2s.c: " Kuninori Morimoto
2019-06-27  2:01 ` [PATCH 21/23] ASoC: tegra: tegra20_ac97.c: " Kuninori Morimoto
2019-06-27  2:01 ` [PATCH 22/23] ASoC: ti: davinci-i2s.c: " Kuninori Morimoto
2019-06-27  2:01 ` [PATCH 23/23] ASoC: ux500: ux500_msp_dai.c: " Kuninori Morimoto

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.