Skip to contentSkip to conversation

ASoC: soc core add inline to handle card list initialzation

PATCH In review Koul, Vinod 1 participant 1 message Jan 13, 2011

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 3/4 ASoC: soc core add inline to handle card list initialzation

From: Vinod Koul <[email protected]>

Currently the soc_probe initializes the card hence it does the card list initialzation. But if machines directly register the card they would need to do these steps, so putting them as inline would save lot of code

This patch adds an inline to do list initialzation

---
 include/sound/soc.h  |   10 ++++++++++
 sound/soc/soc-core.c |    7 +------
 2 files changed, 11 insertions(+), 6 deletions(-)
include/sound/soc.h +10 -0
index accb8a1..541ddfa 100644
@@ -779,6 +779,16 @@ static inline void *snd_soc_pcm_get_drvdata(struct snd_soc_pcm_runtime *rtd)
 	return dev_get_drvdata(&rtd->dev);
 }
 
+static inline void snd_soc_initialize_card_lists(struct snd_soc_card *card)
+{
+	INIT_LIST_HEAD(&card->dai_dev_list);
+	INIT_LIST_HEAD(&card->codec_dev_list);
+	INIT_LIST_HEAD(&card->platform_dev_list);
+	INIT_LIST_HEAD(&card->widgets);
+	INIT_LIST_HEAD(&card->paths);
+	INIT_LIST_HEAD(&card->dapm_list);
+}
+
 #include <sound/soc-dai.h>
 
 #ifdef CONFIG_DEBUG_FS
sound/soc/soc-core.c +1 -6
index 9c5e7cf..8305712 100644
@@ -1872,12 +1872,7 @@ static int soc_probe(struct platform_device *pdev)
 
 	/* Bodge while we unpick instantiation */
 	card->dev = &pdev->dev;
-	INIT_LIST_HEAD(&card->dai_dev_list);
-	INIT_LIST_HEAD(&card->codec_dev_list);
-	INIT_LIST_HEAD(&card->platform_dev_list);
-	INIT_LIST_HEAD(&card->widgets);
-	INIT_LIST_HEAD(&card->paths);
-	INIT_LIST_HEAD(&card->dapm_list);
+	snd_soc_initialize_card_lists(card);
 
 	ret = snd_soc_register_card(card);
 	if (ret != 0) {
Signature · 1 line
1.7.2.3