aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>2015-03-24 05:01:00 -0400
committerMark Brown <broonie@kernel.org>2015-03-24 13:48:56 -0400
commit4e2576bd36a12e78ac3786d05b99a820dffe687f (patch)
tree44c1484139d6f14eccf84f5aa1ca73bb711393cb
parent778952598e53f09251bebe1655177b355cd9e836 (diff)
ASoC: soc-core: initialize debugfs in snd_soc_instantiate_card()
Current soc_init_card_debugfs() is called from snd_soc_register_card() but, soc_cleanup_card_debugfs() is called from soc_cleanup_card_resources(), not from paired function. This differences don't matter for now. But if anyone wants to implement a proper hotplug/unplug, this difference would become clearer. Now, we can assume that snd_soc_instantiate_card() and soc_cleanup_card_resources() are paired function. soc_init_card_debugfs() / soc_cleanup_card_debugfs() paired function should be called from these. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r--sound/soc/soc-core.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index acf99f1250e5..4443581d69f2 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -1662,6 +1662,8 @@ static int snd_soc_instantiate_card(struct snd_soc_card *card)
1662 snd_soc_dapm_sync(&card->dapm); 1662 snd_soc_dapm_sync(&card->dapm);
1663 mutex_unlock(&card->mutex); 1663 mutex_unlock(&card->mutex);
1664 1664
1665 soc_init_card_debugfs(card);
1666
1665 return 0; 1667 return 0;
1666 1668
1667probe_aux_dev_err: 1669probe_aux_dev_err:
@@ -2352,8 +2354,6 @@ int snd_soc_register_card(struct snd_soc_card *card)
2352 2354
2353 snd_soc_initialize_card_lists(card); 2355 snd_soc_initialize_card_lists(card);
2354 2356
2355 soc_init_card_debugfs(card);
2356
2357 card->rtd = devm_kzalloc(card->dev, 2357 card->rtd = devm_kzalloc(card->dev,
2358 sizeof(struct snd_soc_pcm_runtime) * 2358 sizeof(struct snd_soc_pcm_runtime) *
2359 (card->num_links + card->num_aux_devs), 2359 (card->num_links + card->num_aux_devs),
@@ -2384,7 +2384,7 @@ int snd_soc_register_card(struct snd_soc_card *card)
2384 2384
2385 ret = snd_soc_instantiate_card(card); 2385 ret = snd_soc_instantiate_card(card);
2386 if (ret != 0) 2386 if (ret != 0)
2387 soc_cleanup_card_debugfs(card); 2387 return ret;
2388 2388
2389 /* deactivate pins to sleep state */ 2389 /* deactivate pins to sleep state */
2390 for (i = 0; i < card->num_rtd; i++) { 2390 for (i = 0; i < card->num_rtd; i++) {