diff options
Diffstat (limited to 'sound/pci/vx222/vx222.c')
-rw-r--r-- | sound/pci/vx222/vx222.c | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/sound/pci/vx222/vx222.c b/sound/pci/vx222/vx222.c index 1ea1f656a5dc..b89e7a86e9d8 100644 --- a/sound/pci/vx222/vx222.c +++ b/sound/pci/vx222/vx222.c | |||
@@ -258,22 +258,24 @@ static void __devexit snd_vx222_remove(struct pci_dev *pci) | |||
258 | } | 258 | } |
259 | 259 | ||
260 | #ifdef CONFIG_PM | 260 | #ifdef CONFIG_PM |
261 | static int snd_vx222_suspend(struct pci_dev *pci, pm_message_t state) | 261 | static int snd_vx222_suspend(struct device *dev) |
262 | { | 262 | { |
263 | struct snd_card *card = pci_get_drvdata(pci); | 263 | struct pci_dev *pci = to_pci_dev(dev); |
264 | struct snd_card *card = dev_get_drvdata(dev); | ||
264 | struct snd_vx222 *vx = card->private_data; | 265 | struct snd_vx222 *vx = card->private_data; |
265 | int err; | 266 | int err; |
266 | 267 | ||
267 | err = snd_vx_suspend(&vx->core, state); | 268 | err = snd_vx_suspend(&vx->core); |
268 | pci_disable_device(pci); | 269 | pci_disable_device(pci); |
269 | pci_save_state(pci); | 270 | pci_save_state(pci); |
270 | pci_set_power_state(pci, pci_choose_state(pci, state)); | 271 | pci_set_power_state(pci, PCI_D3hot); |
271 | return err; | 272 | return err; |
272 | } | 273 | } |
273 | 274 | ||
274 | static int snd_vx222_resume(struct pci_dev *pci) | 275 | static int snd_vx222_resume(struct device *dev) |
275 | { | 276 | { |
276 | struct snd_card *card = pci_get_drvdata(pci); | 277 | struct pci_dev *pci = to_pci_dev(dev); |
278 | struct snd_card *card = dev_get_drvdata(dev); | ||
277 | struct snd_vx222 *vx = card->private_data; | 279 | struct snd_vx222 *vx = card->private_data; |
278 | 280 | ||
279 | pci_set_power_state(pci, PCI_D0); | 281 | pci_set_power_state(pci, PCI_D0); |
@@ -287,6 +289,11 @@ static int snd_vx222_resume(struct pci_dev *pci) | |||
287 | pci_set_master(pci); | 289 | pci_set_master(pci); |
288 | return snd_vx_resume(&vx->core); | 290 | return snd_vx_resume(&vx->core); |
289 | } | 291 | } |
292 | |||
293 | static SIMPLE_DEV_PM_OPS(snd_vx222_pm, snd_vx222_suspend, snd_vx222_resume); | ||
294 | #define SND_VX222_PM_OPS &snd_vx222_pm | ||
295 | #else | ||
296 | #define SND_VX222_PM_OPS NULL | ||
290 | #endif | 297 | #endif |
291 | 298 | ||
292 | static struct pci_driver vx222_driver = { | 299 | static struct pci_driver vx222_driver = { |
@@ -294,10 +301,9 @@ static struct pci_driver vx222_driver = { | |||
294 | .id_table = snd_vx222_ids, | 301 | .id_table = snd_vx222_ids, |
295 | .probe = snd_vx222_probe, | 302 | .probe = snd_vx222_probe, |
296 | .remove = __devexit_p(snd_vx222_remove), | 303 | .remove = __devexit_p(snd_vx222_remove), |
297 | #ifdef CONFIG_PM | 304 | .driver = { |
298 | .suspend = snd_vx222_suspend, | 305 | .pm = SND_VX222_PM_OPS, |
299 | .resume = snd_vx222_resume, | 306 | }, |
300 | #endif | ||
301 | }; | 307 | }; |
302 | 308 | ||
303 | module_pci_driver(vx222_driver); | 309 | module_pci_driver(vx222_driver); |