aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorJaroslav Kysela <perex@suse.cz>2004-04-24 20:27:36 +0200
committerJaroslav Kysela <perex@suse.cz>2004-04-24 20:27:36 +0200
commitfd26c62954f128bee01402341343dc41d364992e (patch)
treebbe02e71c6cf81c3fd751c6358a33349833e8b78 /sound
parent6cc9a13562883cf4038d2139db05866a16c1ce61 (diff)
downloadhistory-fd26c62954f128bee01402341343dc41d364992e.tar.gz
ALSA CVS update - Takashi Iwai <tiwai@suse.de>
PPC PMAC driver another fix for the new suspend/resume.
Diffstat (limited to 'sound')
-rw-r--r--sound/ppc/pmac.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/sound/ppc/pmac.c b/sound/ppc/pmac.c
index ffadcd84b419ce..ec5291babbb83f 100644
--- a/sound/ppc/pmac.c
+++ b/sound/ppc/pmac.c
@@ -1169,9 +1169,8 @@ int __init snd_pmac_new(snd_card_t *card, pmac_t **chip_return)
#if defined(CONFIG_PM) && defined(CONFIG_PMAC_PBOOK)
/* add sleep notifier */
- snd_pmac_register_sleep_notifier(chip);
- card->set_power_state = snd_pmac_set_power_state;
- card->power_state_private_data = chip;
+ if (! snd_pmac_register_sleep_notifier(chip))
+ snd_card_set_pm_callback(chip->card, snd_pmac_suspend, snd_pmac_resume, chip);
#endif
if ((err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, chip, &ops)) < 0)
@@ -1275,21 +1274,16 @@ static struct pmu_sleep_notifier snd_pmac_sleep_notifier = {
static int __init snd_pmac_register_sleep_notifier(pmac_t *chip)
{
/* should be protected here.. */
- if (sleeping_pmac) {
- snd_printd("sleep notifier already reigistered\n");
- return -EBUSY;
- }
+ snd_assert(! sleeping_pmac, return -EBUSY);
sleeping_pmac = chip;
pmu_register_sleep_notifier(&snd_pmac_sleep_notifier);
- snd_card_set_pm_callback(chip->card, snd_pmac_suspend, snd_pmac_resume, chip);
return 0;
}
static int snd_pmac_unregister_sleep_notifier(pmac_t *chip)
{
/* should be protected here.. */
- if (sleeping_pmac != chip)
- return -ENODEV;
+ snd_assert(sleeping_pmac == chip, return -ENODEV);
pmu_unregister_sleep_notifier(&snd_pmac_sleep_notifier);
sleeping_pmac = NULL;
return 0;