diff options
author | Takashi Iwai <tiwai@suse.de> | 2009-03-17 09:28:13 +0100 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2009-03-17 09:28:13 +0100 |
commit | 37ba1b62836d2440980cf553c49556393b05c6cd (patch) | |
tree | 3bbd9b76117d484d5a624db1b2b9ec0181c7ff55 /sound/isa/opl3sa2.c | |
parent | 1713c0d508fbbb42aa5f90039195e5ac31a50625 (diff) | |
parent | dde332b660cf0bc2baaba678b52768a0fb6e6da2 (diff) | |
download | blackbird-obmc-linux-37ba1b62836d2440980cf553c49556393b05c6cd.tar.gz blackbird-obmc-linux-37ba1b62836d2440980cf553c49556393b05c6cd.zip |
Merge branch 'fix/opl3sa2-suspend' into topic/isa-misc
Diffstat (limited to 'sound/isa/opl3sa2.c')
-rw-r--r-- | sound/isa/opl3sa2.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/sound/isa/opl3sa2.c b/sound/isa/opl3sa2.c index 19b2d0420a26..3f0b877bc8b5 100644 --- a/sound/isa/opl3sa2.c +++ b/sound/isa/opl3sa2.c @@ -554,21 +554,27 @@ static int __devinit snd_opl3sa2_mixer(struct snd_card *card) #ifdef CONFIG_PM static int snd_opl3sa2_suspend(struct snd_card *card, pm_message_t state) { - struct snd_opl3sa2 *chip = card->private_data; + if (card) { + struct snd_opl3sa2 *chip = card->private_data; - snd_power_change_state(card, SNDRV_CTL_POWER_D3hot); - chip->wss->suspend(chip->wss); - /* power down */ - snd_opl3sa2_write(chip, OPL3SA2_PM_CTRL, OPL3SA2_PM_D3); + snd_power_change_state(card, SNDRV_CTL_POWER_D3hot); + chip->wss->suspend(chip->wss); + /* power down */ + snd_opl3sa2_write(chip, OPL3SA2_PM_CTRL, OPL3SA2_PM_D3); + } return 0; } static int snd_opl3sa2_resume(struct snd_card *card) { - struct snd_opl3sa2 *chip = card->private_data; + struct snd_opl3sa2 *chip; int i; + if (!card) + return 0; + + chip = card->private_data; /* power up */ snd_opl3sa2_write(chip, OPL3SA2_PM_CTRL, OPL3SA2_PM_D0); |