ASoC: atmel: use asoc_substream_to_rtd()
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Mon, 20 Jul 2020 01:18:52 +0000 (10:18 +0900)
committerMark Brown <broonie@kernel.org>
Thu, 23 Jul 2020 18:07:33 +0000 (19:07 +0100)
Now we can use asoc_substream_to_rtd() macro,
let's use it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87blkb0ytd.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/atmel/atmel-classd.c
sound/soc/atmel/atmel-pcm-dma.c
sound/soc/atmel/atmel-pcm-pdc.c
sound/soc/atmel/atmel-pdmic.c
sound/soc/atmel/atmel_wm8904.c

index 0469f50..b1a28a9 100644 (file)
@@ -118,7 +118,7 @@ static const struct snd_pcm_hardware atmel_classd_hw = {
 static int atmel_classd_cpu_dai_startup(struct snd_pcm_substream *substream,
                                        struct snd_soc_dai *cpu_dai)
 {
-       struct snd_soc_pcm_runtime *rtd = substream->private_data;
+       struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
        struct atmel_classd *dd = snd_soc_card_get_drvdata(rtd->card);
        int err;
 
@@ -141,7 +141,7 @@ atmel_classd_platform_configure_dma(struct snd_pcm_substream *substream,
        struct snd_pcm_hw_params *params,
        struct dma_slave_config *slave_config)
 {
-       struct snd_soc_pcm_runtime *rtd = substream->private_data;
+       struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
        struct atmel_classd *dd = snd_soc_card_get_drvdata(rtd->card);
 
        if (params_physical_width(params) != 16) {
@@ -338,7 +338,7 @@ atmel_classd_cpu_dai_hw_params(struct snd_pcm_substream *substream,
                               struct snd_pcm_hw_params *params,
                               struct snd_soc_dai *cpu_dai)
 {
-       struct snd_soc_pcm_runtime *rtd = substream->private_data;
+       struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
        struct atmel_classd *dd = snd_soc_card_get_drvdata(rtd->card);
        struct snd_soc_component *component = cpu_dai->component;
        int fs;
@@ -381,7 +381,7 @@ static void
 atmel_classd_cpu_dai_shutdown(struct snd_pcm_substream *substream,
                              struct snd_soc_dai *cpu_dai)
 {
-       struct snd_soc_pcm_runtime *rtd = substream->private_data;
+       struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
        struct atmel_classd *dd = snd_soc_card_get_drvdata(rtd->card);
 
        clk_disable_unprepare(dd->gclk);
index 0a2e956..e597e35 100644 (file)
@@ -53,7 +53,7 @@ static const struct snd_pcm_hardware atmel_pcm_dma_hardware = {
 static void atmel_pcm_dma_irq(u32 ssc_sr,
        struct snd_pcm_substream *substream)
 {
-       struct snd_soc_pcm_runtime *rtd = substream->private_data;
+       struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
        struct atmel_pcm_dma_params *prtd;
 
        prtd = snd_soc_dai_get_dma_data(asoc_rtd_to_cpu(rtd, 0), substream);
@@ -78,7 +78,7 @@ static void atmel_pcm_dma_irq(u32 ssc_sr,
 static int atmel_pcm_configure_dma(struct snd_pcm_substream *substream,
        struct snd_pcm_hw_params *params, struct dma_slave_config *slave_config)
 {
-       struct snd_soc_pcm_runtime *rtd = substream->private_data;
+       struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
        struct atmel_pcm_dma_params *prtd;
        struct ssc_device *ssc;
        int ret;
index a8daebc..704f700 100644 (file)
@@ -205,7 +205,7 @@ static int atmel_pcm_hw_params(struct snd_soc_component *component,
 {
        struct snd_pcm_runtime *runtime = substream->runtime;
        struct atmel_runtime_data *prtd = runtime->private_data;
-       struct snd_soc_pcm_runtime *rtd = substream->private_data;
+       struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
 
        /* this may get called several times by oss emulation
         * with different params */
index c2b6399..8e1d823 100644 (file)
@@ -104,7 +104,7 @@ static struct atmel_pdmic_pdata *atmel_pdmic_dt_init(struct device *dev)
 static int atmel_pdmic_cpu_dai_startup(struct snd_pcm_substream *substream,
                                        struct snd_soc_dai *cpu_dai)
 {
-       struct snd_soc_pcm_runtime *rtd = substream->private_data;
+       struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
        struct atmel_pdmic *dd = snd_soc_card_get_drvdata(rtd->card);
        int ret;
 
@@ -132,7 +132,7 @@ static int atmel_pdmic_cpu_dai_startup(struct snd_pcm_substream *substream,
 static void atmel_pdmic_cpu_dai_shutdown(struct snd_pcm_substream *substream,
                                        struct snd_soc_dai *cpu_dai)
 {
-       struct snd_soc_pcm_runtime *rtd = substream->private_data;
+       struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
        struct atmel_pdmic *dd = snd_soc_card_get_drvdata(rtd->card);
 
        /* Disable the overrun error interrupt */
@@ -145,7 +145,7 @@ static void atmel_pdmic_cpu_dai_shutdown(struct snd_pcm_substream *substream,
 static int atmel_pdmic_cpu_dai_prepare(struct snd_pcm_substream *substream,
                                        struct snd_soc_dai *cpu_dai)
 {
-       struct snd_soc_pcm_runtime *rtd = substream->private_data;
+       struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
        struct atmel_pdmic *dd = snd_soc_card_get_drvdata(rtd->card);
        struct snd_soc_component *component = cpu_dai->component;
        u32 val;
@@ -191,7 +191,7 @@ atmel_pdmic_platform_configure_dma(struct snd_pcm_substream *substream,
                                struct snd_pcm_hw_params *params,
                                struct dma_slave_config *slave_config)
 {
-       struct snd_soc_pcm_runtime *rtd = substream->private_data;
+       struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
        struct atmel_pdmic *dd = snd_soc_card_get_drvdata(rtd->card);
        int ret;
 
@@ -356,7 +356,7 @@ atmel_pdmic_cpu_dai_hw_params(struct snd_pcm_substream *substream,
                              struct snd_pcm_hw_params *params,
                              struct snd_soc_dai *cpu_dai)
 {
-       struct snd_soc_pcm_runtime *rtd = substream->private_data;
+       struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
        struct atmel_pdmic *dd = snd_soc_card_get_drvdata(rtd->card);
        struct snd_soc_component *component = cpu_dai->component;
        unsigned int rate_min = substream->runtime->hw.rate_min;
index 148c943..9e23758 100644 (file)
@@ -26,7 +26,7 @@ static const struct snd_soc_dapm_widget atmel_asoc_wm8904_dapm_widgets[] = {
 static int atmel_asoc_wm8904_hw_params(struct snd_pcm_substream *substream,
                struct snd_pcm_hw_params *params)
 {
-       struct snd_soc_pcm_runtime *rtd = substream->private_data;
+       struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
        struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 0);
        int ret;