ASoC: core: Fix card RTD count for deferred probe.
authorLiam Girdwood <lrg@ti.com>
Tue, 17 Apr 2012 17:00:11 +0000 (18:00 +0100)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Tue, 17 Apr 2012 19:52:19 +0000 (20:52 +0100)
Currently we increment the number of RTD's per card during the DAI link
bind. This can cause an incorrect RTD count when we cannot find a component
and defer the probe (and hence perform the DAI link bind for the card again).

Fix the count so that it is cleared before every card registration
and bind attempt.

Signed-off-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
sound/soc/soc-core.c

index 8d2ebf502df4aa8dc98b68e25024b697f784a6e8..3a4e93e52b6d95a237fe711b7dccf64c58dbfd62 100644 (file)
@@ -3119,6 +3119,7 @@ int snd_soc_register_card(struct snd_soc_card *card)
                                 GFP_KERNEL);
        if (card->rtd == NULL)
                return -ENOMEM;
+       card->num_rtd = 0;
        card->rtd_aux = &card->rtd[card->num_links];
 
        for (i = 0; i < card->num_links; i++)