summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>2019-09-12 13:39:32 +0900
committerMark Brown <broonie@kernel.org>2019-10-01 12:12:15 +0100
commit929deb849b9e4319015070ead7ca976a4f16e303 (patch)
treec23b3f849dd90d139745bc3ac90259bb4b74e9d4
parent753ace0a34fbd39ac2ec654c6859823db420f69e (diff)
downloadlinux-929deb849b9e4319015070ead7ca976a4f16e303.tar.gz
linux-929deb849b9e4319015070ead7ca976a4f16e303.tar.bz2
linux-929deb849b9e4319015070ead7ca976a4f16e303.zip
ASoC: soc-core: create rtd->codec_dais first
soc_new_pcm_runtime() allocs rtd and rtd->codec_dais. This patch allocs both first, and setup these after that. This is prepare for soc_new_pcm_runtime() cleanup. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/87blvqf7qz.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r--sound/soc/soc-core.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 7a3f4783adf6..bc45b0db05ab 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -372,12 +372,6 @@ static struct snd_soc_pcm_runtime *soc_new_pcm_runtime(
if (!rtd)
return NULL;
- INIT_LIST_HEAD(&rtd->component_list);
- rtd->card = card;
- rtd->dai_link = dai_link;
- if (!rtd->dai_link->ops)
- rtd->dai_link->ops = &null_snd_soc_ops;
-
rtd->codec_dais = kcalloc(dai_link->num_codecs,
sizeof(struct snd_soc_dai *),
GFP_KERNEL);
@@ -386,6 +380,12 @@ static struct snd_soc_pcm_runtime *soc_new_pcm_runtime(
return NULL;
}
+ INIT_LIST_HEAD(&rtd->component_list);
+ rtd->card = card;
+ rtd->dai_link = dai_link;
+ if (!rtd->dai_link->ops)
+ rtd->dai_link->ops = &null_snd_soc_ops;
+
/* see for_each_card_rtds */
list_add_tail(&rtd->list, &card->rtd_list);
rtd->num = card->num_rtd;