[alsa-devel] [PATCH 1/7] ASoC: Move card list initialization to snd_soc_register_card

Stephen Warren swarren at nvidia.com
Fri Jan 28 22:26:35 CET 2011


All ASoC cards need snd_soc_initialize_card_lists called. Previously, it was
only called for cards backed by a "soc-audio" platform device, via
soc_probe(). However, it's also needed for cards backed by other platform
devices, and registered directly via snd_soc_register_card().

Signed-off-by: Stephen Warren <swarren at nvidia.com>
---
 sound/soc/soc-core.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 9dfbb8f..3feddd9 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -1881,7 +1881,6 @@ static int soc_probe(struct platform_device *pdev)
 
 	/* Bodge while we unpick instantiation */
 	card->dev = &pdev->dev;
-	snd_soc_initialize_card_lists(card);
 
 	ret = snd_soc_register_card(card);
 	if (ret != 0) {
@@ -3122,6 +3121,8 @@ int snd_soc_register_card(struct snd_soc_card *card)
 	if (!card->name || !card->dev)
 		return -EINVAL;
 
+	snd_soc_initialize_card_lists(card);
+
 	soc_init_card_debugfs(card);
 
 	card->rtd = kzalloc(sizeof(struct snd_soc_pcm_runtime) *
-- 
1.7.1



More information about the Alsa-devel mailing list