ASoC: Move card list initialization to snd_soc_register_card
authorStephen Warren <swarren@nvidia.com>
Fri, 28 Jan 2011 21:26:35 +0000 (14:26 -0700)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Mon, 31 Jan 2011 13:15:35 +0000 (13:15 +0000)
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@nvidia.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
sound/soc/soc-core.c

index 9dfbb8fcb7654e09a5f6f08ea97c037beae9dc95..3feddd91b9734fe5e38e00e538242869b763ed68 100644 (file)
@@ -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) *