]> rtime.felk.cvut.cz Git - linux-imx.git/commitdiff
ASoC: soc core add inline to handle card list initialzation
authorVinod Koul <vinod.koul@intel.com>
Thu, 13 Jan 2011 17:18:52 +0000 (22:48 +0530)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Thu, 13 Jan 2011 23:28:01 +0000 (23:28 +0000)
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>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
include/sound/soc.h
sound/soc/soc-core.c

index accb8a16c165016f6800df9e2992ef9771d5aa62..541ddfaa1243a10e43dcc352360b90846adc606b 100644 (file)
@@ -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
index 9c5e7cff3f01cec3a1edb61d4558551db82c08c9..83057127b2fafda97a06127d0cb641f309d1f412 100644 (file)
@@ -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) {