diff options
author | Lars-Peter Clausen <lars@metafoo.de> | 2014-09-04 13:44:04 -0400 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2014-09-04 15:10:25 -0400 |
commit | 01e0df6647e713469466c7bb6d7157c2e3046192 (patch) | |
tree | 81851a0bc509ccedb9444435ad5834d784b67931 | |
parent | 769b475323463cf7967ec993e8aa573022fbb68b (diff) |
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: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r-- | sound/soc/soc-core.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index 1b422c5c36c8..ff9d2892f473 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c | |||
@@ -3810,8 +3810,10 @@ EXPORT_SYMBOL_GPL(snd_soc_register_card); | |||
3810 | */ | 3810 | */ |
3811 | int snd_soc_unregister_card(struct snd_soc_card *card) | 3811 | int snd_soc_unregister_card(struct snd_soc_card *card) |
3812 | { | 3812 | { |
3813 | if (card->instantiated) | 3813 | if (card->instantiated) { |
3814 | card->instantiated = false; | ||
3814 | soc_cleanup_card_resources(card); | 3815 | soc_cleanup_card_resources(card); |
3816 | } | ||
3815 | dev_dbg(card->dev, "ASoC: Unregistered card '%s'\n", card->name); | 3817 | dev_dbg(card->dev, "ASoC: Unregistered card '%s'\n", card->name); |
3816 | 3818 | ||
3817 | return 0; | 3819 | return 0; |