ASoC: lpass-platform: don't use snd_soc_pcm_set_drvdata()
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Mon, 1 Aug 2016 06:10:54 +0000 (06:10 +0000)
committerMark Brown <broonie@kernel.org>
Tue, 9 Aug 2016 09:38:21 +0000 (10:38 +0100)
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.

qcom/lpass-platform.c sets struct lpass_pcm_data to rtd->dev today,
but we can replace it to struct lpass_data :: private_data.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/qcom/lpass-platform.c
sound/soc/qcom/lpass.h

index db000c6987a1ced1695d9127398cc8a479853c6f..a144c14c7169c3ca26e97810f6bfc48616c59cfc 100644 (file)
@@ -84,9 +84,9 @@ static int lpass_platform_pcmops_hw_params(struct snd_pcm_substream *substream,
                struct snd_pcm_hw_params *params)
 {
        struct snd_soc_pcm_runtime *soc_runtime = substream->private_data;
-       struct lpass_pcm_data *pcm_data = snd_soc_pcm_get_drvdata(soc_runtime);
        struct lpass_data *drvdata =
                snd_soc_platform_get_drvdata(soc_runtime->platform);
+       struct lpass_pcm_data *pcm_data = drvdata->private_data;
        struct lpass_variant *v = drvdata->variant;
        snd_pcm_format_t format = params_format(params);
        unsigned int channels = params_channels(params);
@@ -177,9 +177,9 @@ static int lpass_platform_pcmops_hw_params(struct snd_pcm_substream *substream,
 static int lpass_platform_pcmops_hw_free(struct snd_pcm_substream *substream)
 {
        struct snd_soc_pcm_runtime *soc_runtime = substream->private_data;
-       struct lpass_pcm_data *pcm_data = snd_soc_pcm_get_drvdata(soc_runtime);
        struct lpass_data *drvdata =
                snd_soc_platform_get_drvdata(soc_runtime->platform);
+       struct lpass_pcm_data *pcm_data = drvdata->private_data;
        struct lpass_variant *v = drvdata->variant;
        unsigned int reg;
        int ret;
@@ -201,9 +201,9 @@ static int lpass_platform_pcmops_prepare(struct snd_pcm_substream *substream)
 {
        struct snd_pcm_runtime *runtime = substream->runtime;
        struct snd_soc_pcm_runtime *soc_runtime = substream->private_data;
-       struct lpass_pcm_data *pcm_data = snd_soc_pcm_get_drvdata(soc_runtime);
        struct lpass_data *drvdata =
                snd_soc_platform_get_drvdata(soc_runtime->platform);
+       struct lpass_pcm_data *pcm_data = drvdata->private_data;
        struct lpass_variant *v = drvdata->variant;
        int ret, ch, dir = substream->stream;
 
@@ -255,9 +255,9 @@ static int lpass_platform_pcmops_trigger(struct snd_pcm_substream *substream,
                int cmd)
 {
        struct snd_soc_pcm_runtime *soc_runtime = substream->private_data;
-       struct lpass_pcm_data *pcm_data = snd_soc_pcm_get_drvdata(soc_runtime);
        struct lpass_data *drvdata =
                snd_soc_platform_get_drvdata(soc_runtime->platform);
+       struct lpass_pcm_data *pcm_data = drvdata->private_data;
        struct lpass_variant *v = drvdata->variant;
        int ret, ch, dir = substream->stream;
 
@@ -331,9 +331,9 @@ static snd_pcm_uframes_t lpass_platform_pcmops_pointer(
                struct snd_pcm_substream *substream)
 {
        struct snd_soc_pcm_runtime *soc_runtime = substream->private_data;
-       struct lpass_pcm_data *pcm_data = snd_soc_pcm_get_drvdata(soc_runtime);
        struct lpass_data *drvdata =
                        snd_soc_platform_get_drvdata(soc_runtime->platform);
+       struct lpass_pcm_data *pcm_data = drvdata->private_data;
        struct lpass_variant *v = drvdata->variant;
        unsigned int base_addr, curr_addr;
        int ret, ch, dir = substream->stream;
@@ -483,7 +483,7 @@ static int lpass_platform_pcm_new(struct snd_soc_pcm_runtime *soc_runtime)
                return -ENOMEM;
 
        data->i2s_port = cpu_dai->driver->id;
-       snd_soc_pcm_set_drvdata(soc_runtime, data);
+       drvdata->private_data = data;
 
        psubstream = pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream;
        if (psubstream) {
@@ -570,8 +570,8 @@ static void lpass_platform_pcm_free(struct snd_pcm *pcm)
                substream = pcm->streams[i].substream;
                if (substream) {
                        rt = substream->private_data;
-                       data = snd_soc_pcm_get_drvdata(rt);
                        drvdata = snd_soc_platform_get_drvdata(rt->platform);
+                       data = drvdata->private_data;
 
                        ch = (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
                                ? data->rdma_ch
index 30714ad1e138d405a89643351c4ff30e5b5e2c1f..35b3cea8207d8e61773a938d7fead9b3adb8d087 100644 (file)
@@ -58,6 +58,8 @@ struct lpass_data {
        /* 8016 specific */
        struct clk *pcnoc_mport_clk;
        struct clk *pcnoc_sway_clk;
+
+       void *private_data;
 };
 
 /* Vairant data per each SOC */