Commit 929deb84 authored by Kuninori Morimoto's avatar Kuninori Morimoto Committed by Mark Brown

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: default avatarKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87blvqf7qz.wl-kuninori.morimoto.gx@renesas.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 753ace0a
...@@ -372,12 +372,6 @@ static struct snd_soc_pcm_runtime *soc_new_pcm_runtime( ...@@ -372,12 +372,6 @@ static struct snd_soc_pcm_runtime *soc_new_pcm_runtime(
if (!rtd) if (!rtd)
return NULL; 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, rtd->codec_dais = kcalloc(dai_link->num_codecs,
sizeof(struct snd_soc_dai *), sizeof(struct snd_soc_dai *),
GFP_KERNEL); GFP_KERNEL);
...@@ -386,6 +380,12 @@ static struct snd_soc_pcm_runtime *soc_new_pcm_runtime( ...@@ -386,6 +380,12 @@ static struct snd_soc_pcm_runtime *soc_new_pcm_runtime(
return NULL; 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 */ /* see for_each_card_rtds */
list_add_tail(&rtd->list, &card->rtd_list); list_add_tail(&rtd->list, &card->rtd_list);
rtd->num = card->num_rtd; rtd->num = card->num_rtd;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment