diff options
author | Guennadi Liakhovetski <g.liakhovetski@gmx.de> | 2010-03-18 03:23:33 -0400 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2010-03-19 15:39:18 -0400 |
commit | b2dfa62c525fbe4d89790b6fa90af7c3f1c052ae (patch) | |
tree | ca98c051d54a814493472c48b4ebe8f5cd8a0228 /sound/soc | |
parent | fd23b7dee5e4d369f620979cb120f53629389355 (diff) |
ASoC: remove a card from the list, if instantiation failed
If instantiation of a card failed, we still have to remove it from the
card list on unregistration. This fixes an Oops on Migo-R, triggering,
when after a failed firmware load attempt the driver modules are removed
and re-inserted again.
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc')
-rw-r--r-- | sound/soc/soc-core.c | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index eb73aab78b94..1ff553bbc063 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c | |||
@@ -1283,26 +1283,25 @@ static int soc_remove(struct platform_device *pdev) | |||
1283 | struct snd_soc_platform *platform = card->platform; | 1283 | struct snd_soc_platform *platform = card->platform; |
1284 | struct snd_soc_codec_device *codec_dev = socdev->codec_dev; | 1284 | struct snd_soc_codec_device *codec_dev = socdev->codec_dev; |
1285 | 1285 | ||
1286 | if (!card->instantiated) | 1286 | if (card->instantiated) { |
1287 | return 0; | 1287 | run_delayed_work(&card->delayed_work); |
1288 | 1288 | ||
1289 | run_delayed_work(&card->delayed_work); | 1289 | if (platform->remove) |
1290 | platform->remove(pdev); | ||
1290 | 1291 | ||
1291 | if (platform->remove) | 1292 | if (codec_dev->remove) |
1292 | platform->remove(pdev); | 1293 | codec_dev->remove(pdev); |
1293 | 1294 | ||
1294 | if (codec_dev->remove) | 1295 | for (i = 0; i < card->num_links; i++) { |
1295 | codec_dev->remove(pdev); | 1296 | struct snd_soc_dai *cpu_dai = card->dai_link[i].cpu_dai; |
1297 | if (cpu_dai->remove) | ||
1298 | cpu_dai->remove(pdev, cpu_dai); | ||
1299 | } | ||
1296 | 1300 | ||
1297 | for (i = 0; i < card->num_links; i++) { | 1301 | if (card->remove) |
1298 | struct snd_soc_dai *cpu_dai = card->dai_link[i].cpu_dai; | 1302 | card->remove(pdev); |
1299 | if (cpu_dai->remove) | ||
1300 | cpu_dai->remove(pdev, cpu_dai); | ||
1301 | } | 1303 | } |
1302 | 1304 | ||
1303 | if (card->remove) | ||
1304 | card->remove(pdev); | ||
1305 | |||
1306 | snd_soc_unregister_card(card); | 1305 | snd_soc_unregister_card(card); |
1307 | 1306 | ||
1308 | return 0; | 1307 | return 0; |