summaryrefslogtreecommitdiffstats
path: root/sound/core/init.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2005-10-24 18:16:50 +0200
committerLinus Torvalds <torvalds@g5.osdl.org>2005-10-24 09:45:28 -0700
commitd5c5d8fe32a4b9b14363c6031061e98e26da59a2 (patch)
treec458da42df40e2ea472cb24f129e3b2a9a1dc0d2 /sound/core/init.c
parent10ded9493ec4a566977ed68b65158eba280e61e5 (diff)
downloadop-kernel-dev-d5c5d8fe32a4b9b14363c6031061e98e26da59a2.zip
op-kernel-dev-d5c5d8fe32a4b9b14363c6031061e98e26da59a2.tar.gz
[PATCH] ALSA: Fix Oops of suspend/resume with generic drivers
The patch fixes Oops from sound drivers using generic platform device but have no suspend/resume callbacks. Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'sound/core/init.c')
-rw-r--r--sound/core/init.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sound/core/init.c b/sound/core/init.c
index a570201..c72a791 100644
--- a/sound/core/init.c
+++ b/sound/core/init.c
@@ -828,7 +828,8 @@ static int snd_generic_suspend(struct device *dev, pm_message_t state, u32 level
card = get_snd_generic_card(dev);
if (card->power_state == SNDRV_CTL_POWER_D3hot)
return 0;
- card->pm_suspend(card, PMSG_SUSPEND);
+ if (card->pm_suspend)
+ card->pm_suspend(card, PMSG_SUSPEND);
snd_power_change_state(card, SNDRV_CTL_POWER_D3hot);
return 0;
}
@@ -843,7 +844,8 @@ static int snd_generic_resume(struct device *dev, u32 level)
card = get_snd_generic_card(dev);
if (card->power_state == SNDRV_CTL_POWER_D0)
return 0;
- card->pm_resume(card);
+ if (card->pm_suspend)
+ card->pm_resume(card);
snd_power_change_state(card, SNDRV_CTL_POWER_D0);
return 0;
}
OpenPOWER on IntegriCloud