All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
To: Mark Brown <broonie@kernel.org>
Cc: Linux-ALSA <alsa-devel@alsa-project.org>
Subject: [PATCH 16/29] ASoC: atmel: use asoc_substream_to_rtd()
Date: 20 Jul 2020 10:18:52 +0900	[thread overview]
Message-ID: <87blkb0ytd.wl-kuninori.morimoto.gx@renesas.com> (raw)
In-Reply-To: <87y2nf0yw2.wl-kuninori.morimoto.gx@renesas.com>


From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

Now we can use asoc_substream_to_rtd() macro,
let's use it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 sound/soc/atmel/atmel-classd.c  |  8 ++++----
 sound/soc/atmel/atmel-pcm-dma.c |  4 ++--
 sound/soc/atmel/atmel-pcm-pdc.c |  2 +-
 sound/soc/atmel/atmel-pdmic.c   | 10 +++++-----
 sound/soc/atmel/atmel_wm8904.c  |  2 +-
 5 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/sound/soc/atmel/atmel-classd.c b/sound/soc/atmel/atmel-classd.c
index 0469f50a0366..b1a28a9382fb 100644
--- a/sound/soc/atmel/atmel-classd.c
+++ b/sound/soc/atmel/atmel-classd.c
@@ -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);
diff --git a/sound/soc/atmel/atmel-pcm-dma.c b/sound/soc/atmel/atmel-pcm-dma.c
index 0a2e956232af..e597e35459ce 100644
--- a/sound/soc/atmel/atmel-pcm-dma.c
+++ b/sound/soc/atmel/atmel-pcm-dma.c
@@ -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;
diff --git a/sound/soc/atmel/atmel-pcm-pdc.c b/sound/soc/atmel/atmel-pcm-pdc.c
index a8daebcbf6c8..704f700013d3 100644
--- a/sound/soc/atmel/atmel-pcm-pdc.c
+++ b/sound/soc/atmel/atmel-pcm-pdc.c
@@ -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 */
diff --git a/sound/soc/atmel/atmel-pdmic.c b/sound/soc/atmel/atmel-pdmic.c
index c2b639928c69..8e1d8230b180 100644
--- a/sound/soc/atmel/atmel-pdmic.c
+++ b/sound/soc/atmel/atmel-pdmic.c
@@ -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;
diff --git a/sound/soc/atmel/atmel_wm8904.c b/sound/soc/atmel/atmel_wm8904.c
index 148c943cb538..9e237580afa9 100644
--- a/sound/soc/atmel/atmel_wm8904.c
+++ b/sound/soc/atmel/atmel_wm8904.c
@@ -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;
 
-- 
2.25.1


  parent reply	other threads:[~2020-07-20  1:28 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-20  1:17 [PATCH 00/29] ASoC: add asoc_substream_to_rtd() macro Kuninori Morimoto
2020-07-20  1:17 ` [PATCH 01/29] ASoC: soc-xxx: add asoc_substream_to_rtd() Kuninori Morimoto
2020-07-20  1:17 ` [PATCH 02/29] ASoC: ux500: use asoc_substream_to_rtd() Kuninori Morimoto
2020-07-20  1:17 ` [PATCH 03/29] ASoC: ti: " Kuninori Morimoto
2020-07-20  1:17 ` [PATCH 04/29] ASoC: tegra: " Kuninori Morimoto
2020-07-20  1:17 ` [PATCH 05/29] ASoC: sunxi: " Kuninori Morimoto
2020-07-20  1:18 ` [PATCH 06/29] ASoC: stm: " Kuninori Morimoto
2020-07-20  1:18 ` [PATCH 07/29] ASoC: sof: " Kuninori Morimoto
2020-07-20 15:12   ` Pierre-Louis Bossart
2020-07-20  1:18 ` [PATCH 08/29] ASoC: sh: " Kuninori Morimoto
2020-07-20  1:18 ` [PATCH 09/29] ASoC: samsung: " Kuninori Morimoto
2020-07-20  1:18 ` [PATCH 10/29] ASoC: pxa: " Kuninori Morimoto
2020-07-20  1:18 ` [PATCH 11/29] ASoC: cirrus: " Kuninori Morimoto
2020-07-20  1:18 ` [PATCH 12/29] ASoC: rockchip: " Kuninori Morimoto
2020-07-20  1:18 ` [PATCH 13/29] ASoC: amd: " Kuninori Morimoto
2020-07-20  1:18 ` [PATCH 14/29] ASoC: fsl: " Kuninori Morimoto
2020-07-20  1:18 ` [PATCH 15/29] ASoC: mediatek: " Kuninori Morimoto
2020-07-20  1:18 ` Kuninori Morimoto [this message]
2020-07-20  1:19 ` [PATCH 17/29] ASoC: qcom: " Kuninori Morimoto
2020-07-20  1:19 ` [PATCH 18/29] ASoC: dwc: " Kuninori Morimoto
2020-07-20  1:19 ` [PATCH 19/29] ASoC: intel: " Kuninori Morimoto
2020-07-20 15:17   ` Pierre-Louis Bossart
2020-07-21  1:26     ` Kuninori Morimoto
2020-07-21 22:45       ` Mark Brown
2020-07-20  1:19 ` [PATCH 20/29] ASoC: meson: " Kuninori Morimoto
2020-07-20  1:19 ` [PATCH 21/29] ASoC: au1x: " Kuninori Morimoto
2020-07-20  1:19 ` [PATCH 22/29] ASoC: bcm: " Kuninori Morimoto
2020-07-20  1:19 ` [PATCH 23/29] ASoC: codecs: " Kuninori Morimoto
2020-07-20  1:19 ` [PATCH 24/29] ASoC: generic: " Kuninori Morimoto
2020-07-20  1:19 ` [PATCH 25/29] ASoC: sprd: " Kuninori Morimoto
2020-07-20  1:19 ` [PATCH 26/29] ASoC: kirkwood: " Kuninori Morimoto
2020-07-20  1:19 ` [PATCH 27/29] ASoC: xtensa: " Kuninori Morimoto
2020-07-20  1:19 ` [PATCH 28/29] ASoC: mxs: " Kuninori Morimoto
2020-07-20  1:19 ` [PATCH 29/29] ASoC: uniphier: " Kuninori Morimoto
2020-07-23 20:19 ` [PATCH 00/29] ASoC: add asoc_substream_to_rtd() macro Mark Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87blkb0ytd.wl-kuninori.morimoto.gx@renesas.com \
    --to=kuninori.morimoto.gx@renesas.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.