diff options
author | Takashi Iwai <tiwai@suse.de> | 2005-10-24 12:16:50 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-10-24 12:45:28 -0400 |
commit | d5c5d8fe32a4b9b14363c6031061e98e26da59a2 (patch) | |
tree | c458da42df40e2ea472cb24f129e3b2a9a1dc0d2 /sound | |
parent | 10ded9493ec4a566977ed68b65158eba280e61e5 (diff) |
[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')
-rw-r--r-- | sound/core/init.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sound/core/init.c b/sound/core/init.c index a5702014a704..c72a79115cca 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 | |||
828 | card = get_snd_generic_card(dev); | 828 | card = get_snd_generic_card(dev); |
829 | if (card->power_state == SNDRV_CTL_POWER_D3hot) | 829 | if (card->power_state == SNDRV_CTL_POWER_D3hot) |
830 | return 0; | 830 | return 0; |
831 | card->pm_suspend(card, PMSG_SUSPEND); | 831 | if (card->pm_suspend) |
832 | card->pm_suspend(card, PMSG_SUSPEND); | ||
832 | snd_power_change_state(card, SNDRV_CTL_POWER_D3hot); | 833 | snd_power_change_state(card, SNDRV_CTL_POWER_D3hot); |
833 | return 0; | 834 | return 0; |
834 | } | 835 | } |
@@ -843,7 +844,8 @@ static int snd_generic_resume(struct device *dev, u32 level) | |||
843 | card = get_snd_generic_card(dev); | 844 | card = get_snd_generic_card(dev); |
844 | if (card->power_state == SNDRV_CTL_POWER_D0) | 845 | if (card->power_state == SNDRV_CTL_POWER_D0) |
845 | return 0; | 846 | return 0; |
846 | card->pm_resume(card); | 847 | if (card->pm_suspend) |
848 | card->pm_resume(card); | ||
847 | snd_power_change_state(card, SNDRV_CTL_POWER_D0); | 849 | snd_power_change_state(card, SNDRV_CTL_POWER_D0); |
848 | return 0; | 850 | return 0; |
849 | } | 851 | } |