提交 4e10bda0 编写于 作者: V Vinod Koul 提交者: Mark Brown

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: NVinod Koul <vinod.koul@intel.com>
Signed-off-by: NHarsha Priya <harsha.priya@intel.com>
Signed-off-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
上级 150dd2f8
...@@ -779,6 +779,16 @@ static inline void *snd_soc_pcm_get_drvdata(struct snd_soc_pcm_runtime *rtd) ...@@ -779,6 +779,16 @@ static inline void *snd_soc_pcm_get_drvdata(struct snd_soc_pcm_runtime *rtd)
return dev_get_drvdata(&rtd->dev); 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> #include <sound/soc-dai.h>
#ifdef CONFIG_DEBUG_FS #ifdef CONFIG_DEBUG_FS
......
...@@ -1872,12 +1872,7 @@ static int soc_probe(struct platform_device *pdev) ...@@ -1872,12 +1872,7 @@ static int soc_probe(struct platform_device *pdev)
/* Bodge while we unpick instantiation */ /* Bodge while we unpick instantiation */
card->dev = &pdev->dev; card->dev = &pdev->dev;
INIT_LIST_HEAD(&card->dai_dev_list); snd_soc_initialize_card_lists(card);
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);
ret = snd_soc_register_card(card); ret = snd_soc_register_card(card);
if (ret != 0) { if (ret != 0) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册