@@ -1725,6 +1725,14 @@ static int soc_cleanup_card_resources(struct snd_soc_card *card)
}
+static void snd_soc_remove_card(struct snd_soc_card *card)
+{
+ card->instantiated = false;
+ snd_soc_dapm_shutdown(card);
+ soc_cleanup_card_resources(card);
+}
+
+
/* removes a socdev */
static int soc_remove(struct platform_device *pdev)
{
@@ -2393,9 +2401,7 @@ EXPORT_SYMBOL_GPL(snd_soc_register_card);
int snd_soc_unregister_card(struct snd_soc_card *card)
{
if (card->instantiated) {
- card->instantiated = false;
- snd_soc_dapm_shutdown(card);
- soc_cleanup_card_resources(card);
+ snd_soc_remove_card(card);
dev_dbg(card->dev, "ASoC: Unregistered card '%s'\n", card->name);
}