ASoC: Create card debugfs directory earlier
authorLars-Peter Clausen <lars@metafoo.de>
Thu, 9 Apr 2015 08:52:36 +0000 (10:52 +0200)
committerMark Brown <broonie@kernel.org>
Thu, 9 Apr 2015 10:24:03 +0000 (11:24 +0100)
Create the card debugfs directory at the begining of the initilization
rather then the end as various steps in the initilization sequence will try
to register files and sub-directories in the card directory.

Fixes: 4e2576bd36a1 ("ASoC: soc-core: initialize debugfs in snd_soc_instantiate_card()")
Reported-by: Fabio Estevam <festevam@gmail.com>
Reported-by: Nicolin Chen <nicoleotsuka@gmail.com>
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/soc-core.c

index 71585d0562fa9c2f8ffd97ecfed1f0ace2055dee..3f18fa7f090deca4c6026238a3f7611527cd1046 100644 (file)
@@ -1559,6 +1559,8 @@ static int snd_soc_instantiate_card(struct snd_soc_card *card)
                goto base_error;
        }
 
+       soc_init_card_debugfs(card);
+
        card->dapm.bias_level = SND_SOC_BIAS_OFF;
        card->dapm.dev = card->dev;
        card->dapm.card = card;
@@ -1680,8 +1682,6 @@ static int snd_soc_instantiate_card(struct snd_soc_card *card)
        mutex_unlock(&card->mutex);
        mutex_unlock(&client_mutex);
 
-       soc_init_card_debugfs(card);
-
        return 0;
 
 probe_aux_dev_err:
@@ -1695,6 +1695,7 @@ card_probe_error:
        if (card->remove)
                card->remove(card);
 
+       soc_cleanup_card_debugfs(card);
        snd_card_free(card->snd_card);
 
 base_error: