All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] soc-core: let suspend/resume not called if the card is not instantiated
@ 2009-11-13  4:51 Barry Song
  2009-11-13 13:38 ` Mark Brown
  0 siblings, 1 reply; 8+ messages in thread
From: Barry Song @ 2009-11-13  4:51 UTC (permalink / raw)
  To: broonie; +Cc: uclinux-dist-devel, alsa-devel, Barry Song

It doesn't make sense to call suspend/resume of all cpu/codec dais even
they are not initialized and registered. This will cause many problems
foraudio PM.
The condition card is not instantiated covers codec is null, so delete
the check that codec is null.

Signed-off-by: Barry Song <21cnbao@gmail.com>
---
 sound/soc/soc-core.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index e2b6d75..097f3b9 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -796,10 +796,7 @@ static int soc_suspend(struct device *dev)
 	struct snd_soc_codec *codec = card->codec;
 	int i;
 
-	/* If the initialization of this soc device failed, there is no codec
-	 * associated with it. Just bail out in this case.
-	 */
-	if (!codec)
+	if (!card->instantiated)
 		return 0;
 
 	/* Due to the resume being scheduled into a workqueue we could
@@ -940,6 +937,9 @@ 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 (!card->instantiated)
+		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
-- 
1.5.6.3

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2009-11-16 17:04 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-13  4:51 [PATCH] soc-core: let suspend/resume not called if the card is not instantiated Barry Song
2009-11-13 13:38 ` Mark Brown
2009-11-13 14:56   ` Barry Song
2009-11-13 15:02     ` Mark Brown
2009-11-13 15:29       ` Barry Song
2009-11-13 17:04         ` Mark Brown
2009-11-14  0:46           ` Barry Song
2009-11-16 17:04             ` Mark Brown

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.