提交 d5c5d8fe 编写于 作者: T Takashi Iwai 提交者: Linus Torvalds

[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: NTakashi Iwai <tiwai@suse.de>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 10ded949
......@@ -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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册