aboutsummaryrefslogtreecommitdiffstats
path: root/sound/isa/opl3sa2.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2009-03-17 04:28:13 -0400
committerTakashi Iwai <tiwai@suse.de>2009-03-17 04:28:13 -0400
commit37ba1b62836d2440980cf553c49556393b05c6cd (patch)
tree3bbd9b76117d484d5a624db1b2b9ec0181c7ff55 /sound/isa/opl3sa2.c
parent1713c0d508fbbb42aa5f90039195e5ac31a50625 (diff)
parentdde332b660cf0bc2baaba678b52768a0fb6e6da2 (diff)
Merge branch 'fix/opl3sa2-suspend' into topic/isa-misc
Diffstat (limited to 'sound/isa/opl3sa2.c')
-rw-r--r--sound/isa/opl3sa2.c18
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)
554#ifdef CONFIG_PM 554#ifdef CONFIG_PM
555static int snd_opl3sa2_suspend(struct snd_card *card, pm_message_t state) 555static int snd_opl3sa2_suspend(struct snd_card *card, pm_message_t state)
556{ 556{
557 struct snd_opl3sa2 *chip = card->private_data; 557 if (card) {
558 struct snd_opl3sa2 *chip = card->private_data;
558 559
559 snd_power_change_state(card, SNDRV_CTL_POWER_D3hot); 560 snd_power_change_state(card, SNDRV_CTL_POWER_D3hot);
560 chip->wss->suspend(chip->wss); 561 chip->wss->suspend(chip->wss);
561 /* power down */ 562 /* power down */
562 snd_opl3sa2_write(chip, OPL3SA2_PM_CTRL, OPL3SA2_PM_D3); 563 snd_opl3sa2_write(chip, OPL3SA2_PM_CTRL, OPL3SA2_PM_D3);
564 }
563 565
564 return 0; 566 return 0;
565} 567}
566 568
567static int snd_opl3sa2_resume(struct snd_card *card) 569static int snd_opl3sa2_resume(struct snd_card *card)
568{ 570{
569 struct snd_opl3sa2 *chip = card->private_data; 571 struct snd_opl3sa2 *chip;
570 int i; 572 int i;
571 573
574 if (!card)
575 return 0;
576
577 chip = card->private_data;
572 /* power up */ 578 /* power up */
573 snd_opl3sa2_write(chip, OPL3SA2_PM_CTRL, OPL3SA2_PM_D0); 579 snd_opl3sa2_write(chip, OPL3SA2_PM_CTRL, OPL3SA2_PM_D0);
574 580