aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/ymfpci
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2006-10-11 12:52:53 -0400
committerJaroslav Kysela <perex@suse.cz>2006-10-22 04:51:10 -0400
commit30b35399ceb2398d05837863476dcb12f12f3a82 (patch)
tree14a7cfad1c5d28d207bb1be8addb86ead33f7b63 /sound/pci/ymfpci
parentc06134d73cdc02bb8ab1fad180f6da1f28d2e049 (diff)
[ALSA] Various fixes for suspend/resume of ALSA PCI drivers
- Check the return value of pci_enable_device() and request_irq() in the suspend. If any error occurs there, disable the device using snd_card_disconnect(). - Call pci_set_power_state() properly with pci_choose_state(). - Fix the order to call pci_set_power_state(). - Removed obsolete house-made PM codes in some drivers. Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@suse.cz>
Diffstat (limited to 'sound/pci/ymfpci')
-rw-r--r--sound/pci/ymfpci/ymfpci_main.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/sound/pci/ymfpci/ymfpci_main.c b/sound/pci/ymfpci/ymfpci_main.c
index ebc6da89edf3..a40c1085fd20 100644
--- a/sound/pci/ymfpci/ymfpci_main.c
+++ b/sound/pci/ymfpci/ymfpci_main.c
@@ -2218,6 +2218,7 @@ int snd_ymfpci_suspend(struct pci_dev *pci, pm_message_t state)
2218 snd_ymfpci_disable_dsp(chip); 2218 snd_ymfpci_disable_dsp(chip);
2219 pci_disable_device(pci); 2219 pci_disable_device(pci);
2220 pci_save_state(pci); 2220 pci_save_state(pci);
2221 pci_set_power_state(pci, pci_choose_state(pci, state));
2221 return 0; 2222 return 0;
2222} 2223}
2223 2224
@@ -2227,8 +2228,14 @@ int snd_ymfpci_resume(struct pci_dev *pci)
2227 struct snd_ymfpci *chip = card->private_data; 2228 struct snd_ymfpci *chip = card->private_data;
2228 unsigned int i; 2229 unsigned int i;
2229 2230
2231 pci_set_power_state(pci, PCI_D0);
2230 pci_restore_state(pci); 2232 pci_restore_state(pci);
2231 pci_enable_device(pci); 2233 if (pci_enable_device(pci) < 0) {
2234 printk(KERN_ERR "ymfpci: pci_enable_device failed, "
2235 "disabling device\n");
2236 snd_card_disconnect(card);
2237 return -EIO;
2238 }
2232 pci_set_master(pci); 2239 pci_set_master(pci);
2233 snd_ymfpci_aclink_reset(pci); 2240 snd_ymfpci_aclink_reset(pci);
2234 snd_ymfpci_codec_ready(chip, 0); 2241 snd_ymfpci_codec_ready(chip, 0);