Commit 01e0df66 authored by Lars-Peter Clausen's avatar Lars-Peter Clausen Committed by Mark Brown

ASoC: Set card->instantiated to false when removing the card

Set card->instantiated to false when the card is removed to make sure that
operations that expect the card to be fully instantiated do not run anymore
during card removal.
Signed-off-by: default avatarLars-Peter Clausen <lars@metafoo.de>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 769b4753
...@@ -3810,8 +3810,10 @@ EXPORT_SYMBOL_GPL(snd_soc_register_card); ...@@ -3810,8 +3810,10 @@ EXPORT_SYMBOL_GPL(snd_soc_register_card);
*/ */
int snd_soc_unregister_card(struct snd_soc_card *card) int snd_soc_unregister_card(struct snd_soc_card *card)
{ {
if (card->instantiated) if (card->instantiated) {
card->instantiated = false;
soc_cleanup_card_resources(card); soc_cleanup_card_resources(card);
}
dev_dbg(card->dev, "ASoC: Unregistered card '%s'\n", card->name); dev_dbg(card->dev, "ASoC: Unregistered card '%s'\n", card->name);
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment