[PATCH 6/6] ASoC: soc-pcm: setup pcm at one place in soc_new_pcm()

Kuninori Morimoto kuninori.morimoto.gx at renesas.com
Fri Dec 11 06:55:44 CET 2020


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

pcm is setuped at randam place.
This patch setup it in one place.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx at renesas.com>
---
 sound/soc/soc-pcm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c
index 2f2c4c19f1b8..1bc9fd0fec07 100644
--- a/sound/soc/soc-pcm.c
+++ b/sound/soc/soc-pcm.c
@@ -2749,9 +2749,10 @@ int soc_new_pcm(struct snd_soc_pcm_runtime *rtd, int num)
 	else
 		rtd->close_delayed_work_func = snd_soc_close_delayed_work;
 
-	pcm->nonatomic = rtd->dai_link->nonatomic;
 	rtd->pcm = pcm;
 	pcm->private_data = rtd;
+	pcm->nonatomic = rtd->dai_link->nonatomic;
+	pcm->no_device_suspend = true;
 
 	if (rtd->dai_link->no_pcm || rtd->dai_link->params) {
 		if (playback)
@@ -2808,7 +2809,6 @@ int soc_new_pcm(struct snd_soc_pcm_runtime *rtd, int num)
 		return ret;
 	}
 
-	pcm->no_device_suspend = true;
 out:
 	dev_dbg(rtd->card->dev, "%s <-> %s mapping ok\n",
 		(rtd->num_codecs > 1) ? "multicodec" : asoc_rtd_to_codec(rtd, 0)->name,
-- 
2.25.1



More information about the Alsa-devel mailing list