[alsa-devel] [PATCH 1/4] ASoc: kirkwood: change the pcm/dma stream data pointer
Jean-Francois Moine
moinejf at free.fr
Thu Jul 25 11:13:14 CEST 2013
In the kirkwood pcm/dma driver, the private stream related data pointer
was hold in the platform drvdata.
As this pointer may be used by other parts of the audio subsystem,
this patch uses the substream runtime private data pointer instead.
Signed-off-by: Jean-Francois Moine <moinejf at free.fr>
---
sound/soc/kirkwood/kirkwood-dma.c | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/sound/soc/kirkwood/kirkwood-dma.c b/sound/soc/kirkwood/kirkwood-dma.c
index a9f1453..cef5277 100644
--- a/sound/soc/kirkwood/kirkwood-dma.c
+++ b/sound/soc/kirkwood/kirkwood-dma.c
@@ -127,10 +127,9 @@ static int kirkwood_dma_open(struct snd_pcm_substream *substream)
int err;
struct snd_pcm_runtime *runtime = substream->runtime;
struct snd_soc_pcm_runtime *soc_runtime = substream->private_data;
- struct snd_soc_platform *platform = soc_runtime->platform;
struct snd_soc_dai *cpu_dai = soc_runtime->cpu_dai;
struct kirkwood_dma_data *priv;
- struct kirkwood_dma_priv *prdata = snd_soc_platform_get_drvdata(platform);
+ struct kirkwood_dma_priv *prdata = runtime->private_data;
const struct mbus_dram_target_info *dram;
unsigned long addr;
@@ -171,7 +170,7 @@ static int kirkwood_dma_open(struct snd_pcm_substream *substream)
return -EBUSY;
}
- snd_soc_platform_set_drvdata(platform, prdata);
+ runtime->private_data = prdata;
/*
* Enable Error interrupts. We're only ack'ing them but
@@ -199,8 +198,7 @@ static int kirkwood_dma_close(struct snd_pcm_substream *substream)
{
struct snd_soc_pcm_runtime *soc_runtime = substream->private_data;
struct snd_soc_dai *cpu_dai = soc_runtime->cpu_dai;
- struct snd_soc_platform *platform = soc_runtime->platform;
- struct kirkwood_dma_priv *prdata = snd_soc_platform_get_drvdata(platform);
+ struct kirkwood_dma_priv *prdata = substream->runtime->private_data;
struct kirkwood_dma_data *priv;
priv = snd_soc_dai_get_dma_data(cpu_dai, substream);
@@ -217,7 +215,7 @@ static int kirkwood_dma_close(struct snd_pcm_substream *substream)
writel(0, priv->io + KIRKWOOD_ERR_MASK);
free_irq(priv->irq, prdata);
kfree(prdata);
- snd_soc_platform_set_drvdata(platform, NULL);
+ substream->runtime->private_data = NULL;
}
return 0;
--
1.8.3.2
--
Ken ar c'hentañ | ** Breizh ha Linux atav! **
Jef | http://moinejf.free.fr/
More information about the Alsa-devel
mailing list