From: Vinod Koul Date: Thu, 13 Jan 2011 17:18:52 +0000 (+0530) Subject: ASoC: soc core add inline to handle card list initialzation X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=4e10bda05d6c7d4aba509bbbab5ba748d54c702f;p=GitHub%2Fmt8127%2Fandroid_kernel_alcatel_ttab.git ASoC: soc core add inline to handle card list initialzation 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 Signed-off-by: Harsha Priya Signed-off-by: Mark Brown --- diff --git a/include/sound/soc.h b/include/sound/soc.h index accb8a16c165..541ddfaa1243 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 #ifdef CONFIG_DEBUG_FS diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index 9c5e7cff3f01..83057127b2fa 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) {