Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b2dfa62c authored by Guennadi Liakhovetski's avatar Guennadi Liakhovetski Committed by Mark Brown
Browse files

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: default avatarGuennadi Liakhovetski <g.liakhovetski@gmx.de>
Acked-by: default avatarLiam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
parent fd23b7de
Loading
Loading
Loading
Loading
+13 −14
Original line number Diff line number Diff line
@@ -1283,9 +1283,7 @@ static int soc_remove(struct platform_device *pdev)
	struct snd_soc_platform *platform = card->platform;
	struct snd_soc_codec_device *codec_dev = socdev->codec_dev;

	if (!card->instantiated)
		return 0;

	if (card->instantiated) {
		run_delayed_work(&card->delayed_work);

		if (platform->remove)
@@ -1302,6 +1300,7 @@ static int soc_remove(struct platform_device *pdev)

		if (card->remove)
			card->remove(pdev);
	}

	snd_soc_unregister_card(card);