diff mbox

[1/3] ASoC: sst-haswell-pcm: don't use snd_soc_pcm_set_drvdata()

Message ID 87k2g19gd8.wl%kuninori.morimoto.gx@renesas.com (mailing list archive)
State New, archived
Headers show

Commit Message

Kuninori Morimoto Aug. 1, 2016, 6:09 a.m. UTC
snd_soc_pcm_set_drvdata() will set driver data to rtd->dev,
but driver data of rtd->dev is already used as "rtd" on
soc_post_component_init().

	static int soc_post_component_init(xxx)
	{
		...
		dev_set_drvdata(rtd->dev, rtd);
		...
	}

To remove confusion, snd_soc_pcm_set/get_drvdata() should be
removed soon. This patch is for it.

intel/haswell/sst-haswell-pcm.c is using snd_soc_pcm_set(),
but no one use it on this driver. Let's remove it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---

** Note **

I did compile test only.
Please check it

 sound/soc/intel/haswell/sst-haswell-pcm.c | 1 -
 1 file changed, 1 deletion(-)

Comments

Mark Brown Aug. 8, 2016, 1:16 p.m. UTC | #1
On Mon, Aug 01, 2016 at 06:09:54AM +0000, Kuninori Morimoto wrote:
> 
> snd_soc_pcm_set_drvdata() will set driver data to rtd->dev,
> but driver data of rtd->dev is already used as "rtd" on
> soc_post_component_init().

This doesn't apply against current code, please check and resend.
Kuninori Morimoto Aug. 9, 2016, 3:26 a.m. UTC | #2
Hi Mark

> > snd_soc_pcm_set_drvdata() will set driver data to rtd->dev,
> > but driver data of rtd->dev is already used as "rtd" on
> > soc_post_component_init().
> 
> This doesn't apply against current code, please check and resend.

Thanks.
It seems current your branch already has same patch.
Thus, This [1/3] is not needed now.

commit c999675b04c146aa57f6e853a3746de979427fad
Author: Ben Zhang <benzh@chromium.org>
Date:   Thu Jul 7 18:54:56 2016 -0700

    ASoC: Intel: Fix conflicting pcm dev drvdata on haswell
    
    soc-core sets the snd_soc_pcm_runtime->dev drvdata to
    snd_soc_pcm_runtime in soc_post_component_init, and access
    it in places like codec_reg_show.
    
    hsw_pcm_open overwrites the drvdata to point to hsw_pcm_data,
    confusing soc-core, and causing crashes when cat
    /sys/devices/pci0000:00/INT3438:00/.../System PCM/codec_reg
    
    This patch removes the set in hsw_pcm_open since it's no longer
    used. commit 7ff9d6714a5c ("ASoC: Intel: Split hsw_pcm_data for
    playback and capture") already removed all calls to
    snd_soc_pcm_get_drvdata(rtd).
    
    Signed-off-by: Ben Zhang <benzh@chromium.org>
    Signed-off-by: Mark Brown <broonie@kernel.org>
diff mbox

Patch

diff --git a/sound/soc/intel/haswell/sst-haswell-pcm.c b/sound/soc/intel/haswell/sst-haswell-pcm.c
index 994256b..3154525 100644
--- a/sound/soc/intel/haswell/sst-haswell-pcm.c
+++ b/sound/soc/intel/haswell/sst-haswell-pcm.c
@@ -819,7 +819,6 @@  static int hsw_pcm_open(struct snd_pcm_substream *substream)
 	mutex_lock(&pcm_data->mutex);
 	pm_runtime_get_sync(pdata->dev);
 
-	snd_soc_pcm_set_drvdata(rtd, pcm_data);
 	pcm_data->substream = substream;
 
 	snd_soc_set_runtime_hwparams(substream, &hsw_pcm_hardware);