Skip to content

Commit

Permalink
ASoC: core: On resume also check the soc device state
Browse files Browse the repository at this point in the history
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: Peter Ujfalusi <peter.ujfalusi@nokia.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
  • Loading branch information
Peter Ujfalusi authored and Mark Brown committed Feb 22, 2010
1 parent 6c5f1fe commit b9dd94a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions sound/soc/soc-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -963,6 +963,12 @@ static int soc_resume(struct device *dev)
struct snd_soc_card *card = socdev->card;
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
* need to resume immediately. Other drivers don't have that
* problem and may take a substantial amount of time to resume
Expand Down

0 comments on commit b9dd94a

Please sign in to comment.