diff options
author | Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> | 2019-10-02 08:23:07 +0300 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2019-10-03 16:37:01 +0300 |
commit | d8145989ff8c2a938be372b728f90e23de8557a2 (patch) | |
tree | 77514f4971ade6d64261f0da9c21de34781285ca | |
parent | 50014499e6a45edd7ba1facf2133c03bbc7d8266 (diff) | |
download | linux-d8145989ff8c2a938be372b728f90e23de8557a2.tar.xz |
ASoC: soc-core: setup card->rtd_num at snd_soc_instantiate_card()
card->rtd_num is used to count rtd. Initialize it at
snd_soc_instantiate_card() is very natural and less confusion.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87zhijafgk.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r-- | sound/soc/soc-core.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index 2c2803e6544b..d39d908f3204 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -462,8 +462,6 @@ static void soc_remove_pcm_runtimes(struct snd_soc_card *card) for_each_card_rtds_safe(card, rtd, _rtd) soc_free_pcm_runtime(rtd); - - card->num_rtd = 0; } struct snd_soc_pcm_runtime *snd_soc_get_pcm_runtime(struct snd_soc_card *card, @@ -2008,6 +2006,7 @@ static int snd_soc_instantiate_card(struct snd_soc_card *card) goto probe_end; /* add predefined DAI links to the list */ + card->num_rtd = 0; for_each_card_prelinks(card, i, dai_link) { ret = snd_soc_add_dai_link(card, dai_link); if (ret < 0) @@ -2418,7 +2417,6 @@ int snd_soc_register_card(struct snd_soc_card *card) INIT_LIST_HEAD(&card->dapm_dirty); INIT_LIST_HEAD(&card->dobj_list); - card->num_rtd = 0; card->instantiated = 0; mutex_init(&card->mutex); mutex_init(&card->dapm_mutex); |