diff options
author | Takashi Iwai <tiwai@suse.de> | 2006-10-11 12:52:53 -0400 |
---|---|---|
committer | Jaroslav Kysela <perex@suse.cz> | 2006-10-22 04:51:10 -0400 |
commit | 30b35399ceb2398d05837863476dcb12f12f3a82 (patch) | |
tree | 14a7cfad1c5d28d207bb1be8addb86ead33f7b63 /sound/pci/vx222 | |
parent | c06134d73cdc02bb8ab1fad180f6da1f28d2e049 (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/vx222')
-rw-r--r-- | sound/pci/vx222/vx222.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/sound/pci/vx222/vx222.c b/sound/pci/vx222/vx222.c index e7cd8acab59a..af49e8aabf55 100644 --- a/sound/pci/vx222/vx222.c +++ b/sound/pci/vx222/vx222.c | |||
@@ -266,9 +266,9 @@ static int snd_vx222_suspend(struct pci_dev *pci, pm_message_t state) | |||
266 | int err; | 266 | int err; |
267 | 267 | ||
268 | err = snd_vx_suspend(&vx->core, state); | 268 | err = snd_vx_suspend(&vx->core, state); |
269 | pci_set_power_state(pci, PCI_D3hot); | ||
270 | pci_disable_device(pci); | 269 | pci_disable_device(pci); |
271 | pci_save_state(pci); | 270 | pci_save_state(pci); |
271 | pci_set_power_state(pci, pci_choose_state(pci, state)); | ||
272 | return err; | 272 | return err; |
273 | } | 273 | } |
274 | 274 | ||
@@ -277,9 +277,14 @@ static int snd_vx222_resume(struct pci_dev *pci) | |||
277 | struct snd_card *card = pci_get_drvdata(pci); | 277 | struct snd_card *card = pci_get_drvdata(pci); |
278 | struct snd_vx222 *vx = card->private_data; | 278 | struct snd_vx222 *vx = card->private_data; |
279 | 279 | ||
280 | pci_restore_state(pci); | ||
281 | pci_enable_device(pci); | ||
282 | pci_set_power_state(pci, PCI_D0); | 280 | pci_set_power_state(pci, PCI_D0); |
281 | pci_restore_state(pci); | ||
282 | if (pci_enable_device(pci) < 0) { | ||
283 | printk(KERN_ERR "vx222: pci_enable_device failed, " | ||
284 | "disabling device\n"); | ||
285 | snd_card_disconnect(card); | ||
286 | return -EIO; | ||
287 | } | ||
283 | pci_set_master(pci); | 288 | pci_set_master(pci); |
284 | return snd_vx_resume(&vx->core); | 289 | return snd_vx_resume(&vx->core); |
285 | } | 290 | } |