Skip to content

Commit

Permalink
[PATCH] ALSA: Fix Oops of suspend/resume with generic drivers
Browse files Browse the repository at this point in the history
The patch fixes Oops from sound drivers using generic platform device
but have no suspend/resume callbacks.

Signed-off-by: Takashi Iwai <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
tiwai authored and Linus Torvalds committed Oct 24, 2005
1 parent 10ded94 commit d5c5d8f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions sound/core/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -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;
}
Expand Down

0 comments on commit d5c5d8f

Please sign in to comment.