summaryrefslogtreecommitdiffstats
path: root/sound/soc
diff options
context:
space:
mode:
authorPeter Ujfalusi <peter.ujfalusi@nokia.com>2010-02-22 12:27:13 +0100
committerMark Brown <broonie@opensource.wolfsonmicro.com>2010-02-22 15:39:42 +0100
commitb9dd94a87e5b4d0e864636698931aeeeb3c9d770 (patch)
treea605b64474c3e4e6016720b62f479f1e1b6eaca5 /sound/soc
parentASoC: Make pmdown_time a long (diff)
downloadlinux-b9dd94a87e5b4d0e864636698931aeeeb3c9d770.tar.xz
linux-b9dd94a87e5b4d0e864636698931aeeeb3c9d770.zip
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: Peter Ujfalusi <peter.ujfalusi@nokia.com> 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.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index e1c0336868e1..a03bac943aaf 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -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