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

Commit b9dd94a8 authored by Peter Ujfalusi's avatar Peter Ujfalusi Committed by Mark Brown
Browse files

ASoC: core: On resume also check the soc device state



Check the card->codec on soc_resume to detect if the soc
device is properly initialized.
If the card->codec is NULL, than do not continue the resume
operation, since the device is not initialized properly.

Signed-off-by: default avatarPeter Ujfalusi <peter.ujfalusi@nokia.com>
Acked-by: default avatarLiam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
parent 6c5f1fed
Loading
Loading
Loading
Loading
+6 −0
Original line number Original line Diff line number Diff line
@@ -963,6 +963,12 @@ static int soc_resume(struct device *dev)
	struct snd_soc_card *card = socdev->card;
	struct snd_soc_card *card = socdev->card;
	struct snd_soc_dai *cpu_dai = card->dai_link[0].cpu_dai;
	struct snd_soc_dai *cpu_dai = card->dai_link[0].cpu_dai;


	/* If the initialization of this soc device failed, there is no codec
	 * associated with it. Just bail out in this case.
	 */
	if (!card->codec)
		return 0;

	/* AC97 devices might have other drivers hanging off them so
	/* AC97 devices might have other drivers hanging off them so
	 * need to resume immediately.  Other drivers don't have that
	 * need to resume immediately.  Other drivers don't have that
	 * problem and may take a substantial amount of time to resume
	 * problem and may take a substantial amount of time to resume