* [PATCH 3/4] ASoC: soc core add inline to handle card list initialzation
@ 2011-01-13 17:18 Koul, Vinod
0 siblings, 0 replies; only message in thread
From: Koul, Vinod @ 2011-01-13 17:18 UTC (permalink / raw)
To: alsa-devel; +Cc: Vinod Koul, Harsha Priya, broonie, selma.bensaid, lrg
From: Vinod Koul <vinod.koul@intel.com>
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
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Harsha Priya <harsha.priya@intel.com>
---
include/sound/soc.h | 10 ++++++++++
sound/soc/soc-core.c | 7 +------
2 files changed, 11 insertions(+), 6 deletions(-)
diff --git a/include/sound/soc.h b/include/sound/soc.h
index accb8a1..541ddfa 100644
--- a/include/sound/soc.h
+++ b/include/sound/soc.h
@@ -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
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 9c5e7cf..8305712 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -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) {
--
1.7.2.3
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2011-01-13 17:16 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-13 17:18 [PATCH 3/4] ASoC: soc core add inline to handle card list initialzation Koul, Vinod
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).