alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/4] drop unneeded snd_soc_dai_set_drvdata
@ 2021-02-13 10:19 Julia Lawall
  2021-02-13 10:19 ` [PATCH 1/4] ASoC: mmp-sspa: " Julia Lawall
                   ` (4 more replies)
  0 siblings, 5 replies; 7+ messages in thread
From: Julia Lawall @ 2021-02-13 10:19 UTC (permalink / raw)
  To: Jernej Skrabec
  Cc: alsa-devel, linux-kernel, kernel-janitors, Takashi Iwai,
	Liam Girdwood, Mark Brown, NXP Linux Team,
	Pengutronix Kernel Team, Fabio Estevam, linux-arm-kernel

snd_soc_dai_set_drvdata is not needed when the set data comes from
snd_soc_dai_get_drvdata or dev_get_drvdata.  

---

 sound/soc/fsl/fsl_micfil.c  |    2 --
 sound/soc/fsl/fsl_sai.c     |    2 --
 sound/soc/fsl/fsl_xcvr.c    |    1 -
 sound/soc/mxs/mxs-saif.c    |   10 ----------
 sound/soc/pxa/mmp-sspa.c    |    1 -
 sound/soc/sunxi/sun4i-i2s.c |    2 --
 6 files changed, 18 deletions(-)

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

* [PATCH 1/4] ASoC: mmp-sspa: drop unneeded snd_soc_dai_set_drvdata
  2021-02-13 10:19 [PATCH 0/4] drop unneeded snd_soc_dai_set_drvdata Julia Lawall
@ 2021-02-13 10:19 ` Julia Lawall
  2021-02-13 10:19 ` [PATCH 2/4] ASoC: mxs-saif: " Julia Lawall
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: Julia Lawall @ 2021-02-13 10:19 UTC (permalink / raw)
  To: Daniel Mack
  Cc: alsa-devel, linux-kernel, Takashi Iwai, kernel-janitors,
	Liam Girdwood, Haojian Zhuang, Mark Brown, Robert Jarzmik,
	linux-arm-kernel

snd_soc_dai_set_drvdata is not needed when the set data comes from
snd_soc_dai_get_drvdata or dev_get_drvdata.  The problem was fixed
usingthe following semantic patch: (http://coccinelle.lip6.fr/)

// <smpl>
@@
expression x,y,e;
@@
	x = dev_get_drvdata(y->dev)
	... when != x = e
-	snd_soc_dai_set_drvdata(y,x);

@@
expression x,y,e;
@@
	x = snd_soc_dai_get_drvdata(y)
	... when != x = e
-	snd_soc_dai_set_drvdata(y,x);
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@inria.fr>

---
 sound/soc/pxa/mmp-sspa.c |    1 -
 1 file changed, 1 deletion(-)

diff --git a/sound/soc/pxa/mmp-sspa.c b/sound/soc/pxa/mmp-sspa.c
index 4803972ee655..7e39210a0b38 100644
--- a/sound/soc/pxa/mmp-sspa.c
+++ b/sound/soc/pxa/mmp-sspa.c
@@ -330,7 +330,6 @@ static int mmp_sspa_probe(struct snd_soc_dai *dai)
 				&sspa->playback_dma_data,
 				&sspa->capture_dma_data);
 
-	snd_soc_dai_set_drvdata(dai, sspa);
 	return 0;
 }
 


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

* [PATCH 2/4] ASoC: mxs-saif: drop unneeded snd_soc_dai_set_drvdata
  2021-02-13 10:19 [PATCH 0/4] drop unneeded snd_soc_dai_set_drvdata Julia Lawall
  2021-02-13 10:19 ` [PATCH 1/4] ASoC: mmp-sspa: " Julia Lawall
@ 2021-02-13 10:19 ` Julia Lawall
  2021-02-13 10:19 ` [PATCH 3/4] ASoC: sun4i-i2s: " Julia Lawall
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: Julia Lawall @ 2021-02-13 10:19 UTC (permalink / raw)
  To: Liam Girdwood
  Cc: alsa-devel, linux-kernel, Fabio Estevam, Sascha Hauer,
	kernel-janitors, Takashi Iwai, Mark Brown, NXP Linux Team,
	Pengutronix Kernel Team, Shawn Guo, linux-arm-kernel

snd_soc_dai_set_drvdata is not needed when the set data comes from
snd_soc_dai_get_drvdata or dev_get_drvdata.  The problem was fixed
usingthe following semantic patch: (http://coccinelle.lip6.fr/)

// <smpl>
@@
expression x,y,e;
@@
	x = dev_get_drvdata(y->dev)
	... when != x = e
-	snd_soc_dai_set_drvdata(y,x);

@@
expression x,y,e;
@@
	x = snd_soc_dai_get_drvdata(y)
	... when != x = e
-	snd_soc_dai_set_drvdata(y,x);
// </smpl>

In this case, the whole probe function then does nothing, so drop it.

Signed-off-by: Julia Lawall <Julia.Lawall@inria.fr>

---
 sound/soc/mxs/mxs-saif.c |   10 ----------
 1 file changed, 10 deletions(-)

diff --git a/sound/soc/mxs/mxs-saif.c b/sound/soc/mxs/mxs-saif.c
index 07f8cf9980e3..6a2d24d48964 100644
--- a/sound/soc/mxs/mxs-saif.c
+++ b/sound/soc/mxs/mxs-saif.c
@@ -642,18 +642,8 @@ static const struct snd_soc_dai_ops mxs_saif_dai_ops = {
 	.set_fmt = mxs_saif_set_dai_fmt,
 };
 
-static int mxs_saif_dai_probe(struct snd_soc_dai *dai)
-{
-	struct mxs_saif *saif = dev_get_drvdata(dai->dev);
-
-	snd_soc_dai_set_drvdata(dai, saif);
-
-	return 0;
-}
-
 static struct snd_soc_dai_driver mxs_saif_dai = {
 	.name = "mxs-saif",
-	.probe = mxs_saif_dai_probe,
 	.playback = {
 		.channels_min = 2,
 		.channels_max = 2,


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

* [PATCH 3/4] ASoC: sun4i-i2s: drop unneeded snd_soc_dai_set_drvdata
  2021-02-13 10:19 [PATCH 0/4] drop unneeded snd_soc_dai_set_drvdata Julia Lawall
  2021-02-13 10:19 ` [PATCH 1/4] ASoC: mmp-sspa: " Julia Lawall
  2021-02-13 10:19 ` [PATCH 2/4] ASoC: mxs-saif: " Julia Lawall
@ 2021-02-13 10:19 ` Julia Lawall
  2021-02-13 10:19 ` [PATCH 4/4] ASoC: fsl: " Julia Lawall
  2021-03-01 23:34 ` [PATCH 0/4] " Mark Brown
  4 siblings, 0 replies; 7+ messages in thread
From: Julia Lawall @ 2021-02-13 10:19 UTC (permalink / raw)
  To: Liam Girdwood
  Cc: Jernej Skrabec, alsa-devel, linux-kernel, kernel-janitors,
	Takashi Iwai, Maxime Ripard, Chen-Yu Tsai, Mark Brown,
	linux-arm-kernel

snd_soc_dai_set_drvdata is not needed when the set data comes from
snd_soc_dai_get_drvdata or dev_get_drvdata.  The problem was fixed
usingthe following semantic patch: (http://coccinelle.lip6.fr/)

// <smpl>
@@
expression x,y,e;
@@
	x = dev_get_drvdata(y->dev)
	... when != x = e
-	snd_soc_dai_set_drvdata(y,x);

@@
expression x,y,e;
@@
	x = snd_soc_dai_get_drvdata(y)
	... when != x = e
-	snd_soc_dai_set_drvdata(y,x);
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@inria.fr>

---
 sound/soc/sunxi/sun4i-i2s.c |    2 --
 1 file changed, 2 deletions(-)

diff --git a/sound/soc/sunxi/sun4i-i2s.c b/sound/soc/sunxi/sun4i-i2s.c
index 78506c3811dc..c57feae3396e 100644
--- a/sound/soc/sunxi/sun4i-i2s.c
+++ b/sound/soc/sunxi/sun4i-i2s.c
@@ -1079,8 +1079,6 @@ static int sun4i_i2s_dai_probe(struct snd_soc_dai *dai)
 				  &i2s->playback_dma_data,
 				  &i2s->capture_dma_data);
 
-	snd_soc_dai_set_drvdata(dai, i2s);
-
 	return 0;
 }
 


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

* [PATCH 4/4] ASoC: fsl: drop unneeded snd_soc_dai_set_drvdata
  2021-02-13 10:19 [PATCH 0/4] drop unneeded snd_soc_dai_set_drvdata Julia Lawall
                   ` (2 preceding siblings ...)
  2021-02-13 10:19 ` [PATCH 3/4] ASoC: sun4i-i2s: " Julia Lawall
@ 2021-02-13 10:19 ` Julia Lawall
  2021-02-18  6:30   ` Nicolin Chen
  2021-03-01 23:34 ` [PATCH 0/4] " Mark Brown
  4 siblings, 1 reply; 7+ messages in thread
From: Julia Lawall @ 2021-02-13 10:19 UTC (permalink / raw)
  To: Timur Tabi
  Cc: alsa-devel, linuxppc-dev, Xiubo Li, Shengjiu Wang, Takashi Iwai,
	kernel-janitors, Liam Girdwood, Nicolin Chen, Mark Brown,
	Fabio Estevam, linux-kernel

snd_soc_dai_set_drvdata is not needed when the set data comes from
snd_soc_dai_get_drvdata or dev_get_drvdata.  The problem was fixed
usingthe following semantic patch: (http://coccinelle.lip6.fr/)

// <smpl>
@@
expression x,y,e;
@@
	x = dev_get_drvdata(y->dev)
	... when != x = e
-	snd_soc_dai_set_drvdata(y,x);

@@
expression x,y,e;
@@
	x = snd_soc_dai_get_drvdata(y)
	... when != x = e
-	snd_soc_dai_set_drvdata(y,x);
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@inria.fr>

---
 sound/soc/fsl/fsl_micfil.c |    2 --
 sound/soc/fsl/fsl_sai.c    |    2 --
 sound/soc/fsl/fsl_xcvr.c   |    1 -
 3 files changed, 5 deletions(-)

diff --git a/sound/soc/fsl/fsl_micfil.c b/sound/soc/fsl/fsl_micfil.c
index 8aedf6590b28..fd21017fa2bd 100644
--- a/sound/soc/fsl/fsl_micfil.c
+++ b/sound/soc/fsl/fsl_micfil.c
@@ -423,8 +423,6 @@ static int fsl_micfil_dai_probe(struct snd_soc_dai *cpu_dai)
 		return ret;
 	}
 
-	snd_soc_dai_set_drvdata(cpu_dai, micfil);
-
 	return 0;
 }
 
diff --git a/sound/soc/fsl/fsl_sai.c b/sound/soc/fsl/fsl_sai.c
index 5e65b456d3e2..8876d0ed37d9 100644
--- a/sound/soc/fsl/fsl_sai.c
+++ b/sound/soc/fsl/fsl_sai.c
@@ -727,8 +727,6 @@ static int fsl_sai_dai_probe(struct snd_soc_dai *cpu_dai)
 	snd_soc_dai_init_dma_data(cpu_dai, &sai->dma_params_tx,
 				&sai->dma_params_rx);
 
-	snd_soc_dai_set_drvdata(cpu_dai, sai);
-
 	return 0;
 }
 
diff --git a/sound/soc/fsl/fsl_xcvr.c b/sound/soc/fsl/fsl_xcvr.c
index dd228b421e2c..8a3bde718697 100644
--- a/sound/soc/fsl/fsl_xcvr.c
+++ b/sound/soc/fsl/fsl_xcvr.c
@@ -869,7 +869,6 @@ static int fsl_xcvr_dai_probe(struct snd_soc_dai *dai)
 	struct fsl_xcvr *xcvr = snd_soc_dai_get_drvdata(dai);
 
 	snd_soc_dai_init_dma_data(dai, &xcvr->dma_prms_tx, &xcvr->dma_prms_rx);
-	snd_soc_dai_set_drvdata(dai, xcvr);
 
 	snd_soc_add_dai_controls(dai, &fsl_xcvr_mode_kctl, 1);
 	snd_soc_add_dai_controls(dai, &fsl_xcvr_arc_mode_kctl, 1);


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

* Re: [PATCH 4/4] ASoC: fsl: drop unneeded snd_soc_dai_set_drvdata
  2021-02-13 10:19 ` [PATCH 4/4] ASoC: fsl: " Julia Lawall
@ 2021-02-18  6:30   ` Nicolin Chen
  0 siblings, 0 replies; 7+ messages in thread
From: Nicolin Chen @ 2021-02-18  6:30 UTC (permalink / raw)
  To: Julia Lawall
  Cc: alsa-devel, linuxppc-dev, Timur Tabi, Xiubo Li, Shengjiu Wang,
	Takashi Iwai, kernel-janitors, Liam Girdwood, Mark Brown,
	Fabio Estevam, linux-kernel

On Sat, Feb 13, 2021 at 11:19:07AM +0100, Julia Lawall wrote:
> snd_soc_dai_set_drvdata is not needed when the set data comes from
> snd_soc_dai_get_drvdata or dev_get_drvdata.  The problem was fixed
> usingthe following semantic patch: (http://coccinelle.lip6.fr/)
> 
> // <smpl>
> @@
> expression x,y,e;
> @@
> 	x = dev_get_drvdata(y->dev)
> 	... when != x = e
> -	snd_soc_dai_set_drvdata(y,x);
> 
> @@
> expression x,y,e;
> @@
> 	x = snd_soc_dai_get_drvdata(y)
> 	... when != x = e
> -	snd_soc_dai_set_drvdata(y,x);
> // </smpl>
> 
> Signed-off-by: Julia Lawall <Julia.Lawall@inria.fr>

Acked-by: Nicolin Chen <nicoleotsuka@gmail.com>

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

* Re: [PATCH 0/4] drop unneeded snd_soc_dai_set_drvdata
  2021-02-13 10:19 [PATCH 0/4] drop unneeded snd_soc_dai_set_drvdata Julia Lawall
                   ` (3 preceding siblings ...)
  2021-02-13 10:19 ` [PATCH 4/4] ASoC: fsl: " Julia Lawall
@ 2021-03-01 23:34 ` Mark Brown
  4 siblings, 0 replies; 7+ messages in thread
From: Mark Brown @ 2021-03-01 23:34 UTC (permalink / raw)
  To: Julia Lawall, Jernej Skrabec
  Cc: alsa-devel, linux-kernel, kernel-janitors, Liam Girdwood,
	Takashi Iwai, NXP Linux Team, Pengutronix Kernel Team,
	Fabio Estevam, linux-arm-kernel

On Sat, 13 Feb 2021 11:19:03 +0100, Julia Lawall wrote:
> snd_soc_dai_set_drvdata is not needed when the set data comes from
> snd_soc_dai_get_drvdata or dev_get_drvdata.

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next

Thanks!

[1/4] ASoC: mmp-sspa: drop unneeded snd_soc_dai_set_drvdata
      commit: 131036ffae211a9cc3bfb053fadce87484e13fc5
[2/4] ASoC: mxs-saif: drop unneeded snd_soc_dai_set_drvdata
      commit: 7150186f1edb2fa94554be1bec26aa65a7df3388
[3/4] ASoC: sun4i-i2s: drop unneeded snd_soc_dai_set_drvdata
      commit: 0c34af2d5c9ba5103637c33c4f52d658172b991d
[4/4] ASoC: fsl: drop unneeded snd_soc_dai_set_drvdata
      commit: eb9db3066cdb57dbfd1fb3d85ca143ad5d719bfb

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

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

end of thread, other threads:[~2021-03-01 23:41 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-13 10:19 [PATCH 0/4] drop unneeded snd_soc_dai_set_drvdata Julia Lawall
2021-02-13 10:19 ` [PATCH 1/4] ASoC: mmp-sspa: " Julia Lawall
2021-02-13 10:19 ` [PATCH 2/4] ASoC: mxs-saif: " Julia Lawall
2021-02-13 10:19 ` [PATCH 3/4] ASoC: sun4i-i2s: " Julia Lawall
2021-02-13 10:19 ` [PATCH 4/4] ASoC: fsl: " Julia Lawall
2021-02-18  6:30   ` Nicolin Chen
2021-03-01 23:34 ` [PATCH 0/4] " Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).