[26/28] ASoC: soc-core: initialize list at one place
diff mbox series

Message ID 87zhkn13ta.wl-kuninori.morimoto.gx@renesas.com
State New
Headers show
Series
  • ASoC: cleanup patches for soc-core
Related show

Commit Message

Kuninori Morimoto Aug. 6, 2019, 1:30 a.m. UTC
From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

Initialize component related list at random place is very difficult
to read. This patch initialize it at snd_soc_component_initialize().

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

Patch
diff mbox series

diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 666851b..ef0f2d3 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -1263,7 +1263,6 @@  static int soc_probe_component(struct snd_soc_card *card,
 
 	component->card = card;
 	dapm->card = card;
-	INIT_LIST_HEAD(&component->card_list);
 	INIT_LIST_HEAD(&dapm->list);
 	soc_set_name_prefix(card, component);
 
@@ -2643,6 +2642,8 @@  static int snd_soc_component_initialize(struct snd_soc_component *component,
 
 	INIT_LIST_HEAD(&component->dai_list);
 	INIT_LIST_HEAD(&component->list);
+	INIT_LIST_HEAD(&component->dobj_list);
+	INIT_LIST_HEAD(&component->card_list);
 	mutex_init(&component->io_mutex);
 
 	component->name = fmt_single_name(dev, &component->id);
@@ -2728,7 +2729,6 @@  static void snd_soc_component_add(struct snd_soc_component *component)
 
 	/* see for_each_component */
 	list_add(&component->list, &component_list);
-	INIT_LIST_HEAD(&component->dobj_list);
 
 	mutex_unlock(&client_mutex);
 }