]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
[PATCH] ALSA: Fix Oops of suspend/resume with generic drivers
authorTakashi Iwai <tiwai@suse.de>
Mon, 24 Oct 2005 16:16:50 +0000 (18:16 +0200)
committerLinus Torvalds <torvalds@g5.osdl.org>
Mon, 24 Oct 2005 16:45:28 +0000 (09:45 -0700)
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>
sound/core/init.c

index a5702014a704e0ffcbf153156532fd69a151601b..c72a79115cca2e64ecc36fc9de1fae40bc24f2f3 100644 (file)
@@ -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;
 }