@@ -487,6 +487,10 @@ static int snd_card_do_free(struct snd_card *card)
dev_warn(card->dev, "unable to free card info\n");
/* Not fatal error */
}
+#ifdef CONFIG_SND_DEBUG
+ debugfs_remove(card->debugfs_root);
+ card->debugfs_root = NULL;
+#endif
if (card->release_completion)
complete(card->release_completion);
kfree(card);
@@ -537,11 +541,6 @@ int snd_card_free(struct snd_card *card)
/* wait, until all devices are ready for the free operation */
wait_for_completion(&released);
-#ifdef CONFIG_SND_DEBUG
- debugfs_remove(card->debugfs_root);
- card->debugfs_root = NULL;
-#endif
-
return 0;
}
EXPORT_SYMBOL(snd_card_free);