diff options
author | Takashi Iwai <tiwai@suse.de> | 2012-07-02 09:20:37 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2012-07-03 02:23:03 -0400 |
commit | 68cb2b559278858ef9f3a7722f95df88797c7840 (patch) | |
tree | 3dd568aac5e1004ffd1e8400aa5a50ca6a11ad01 /sound/pci/atiixp.c | |
parent | 284e7ca75f96a18f182cce38ba76ee724fb97e16 (diff) |
ALSA: Convert to new pm_ops for PCI drivers
Straightforward conversion to the new pm_ops from the legacy
suspend/resume ops.
Since we change vx222, vx_core and vxpocket have to be converted,
too.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/atiixp.c')
-rw-r--r-- | sound/pci/atiixp.c | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/sound/pci/atiixp.c b/sound/pci/atiixp.c index 156a94f8a123..31020d2a868b 100644 --- a/sound/pci/atiixp.c +++ b/sound/pci/atiixp.c | |||
@@ -1462,9 +1462,10 @@ static int __devinit snd_atiixp_mixer_new(struct atiixp *chip, int clock, | |||
1462 | /* | 1462 | /* |
1463 | * power management | 1463 | * power management |
1464 | */ | 1464 | */ |
1465 | static int snd_atiixp_suspend(struct pci_dev *pci, pm_message_t state) | 1465 | static int snd_atiixp_suspend(struct device *dev) |
1466 | { | 1466 | { |
1467 | struct snd_card *card = pci_get_drvdata(pci); | 1467 | struct pci_dev *pci = to_pci_dev(dev); |
1468 | struct snd_card *card = dev_get_drvdata(dev); | ||
1468 | struct atiixp *chip = card->private_data; | 1469 | struct atiixp *chip = card->private_data; |
1469 | int i; | 1470 | int i; |
1470 | 1471 | ||
@@ -1484,13 +1485,14 @@ static int snd_atiixp_suspend(struct pci_dev *pci, pm_message_t state) | |||
1484 | 1485 | ||
1485 | pci_disable_device(pci); | 1486 | pci_disable_device(pci); |
1486 | pci_save_state(pci); | 1487 | pci_save_state(pci); |
1487 | pci_set_power_state(pci, pci_choose_state(pci, state)); | 1488 | pci_set_power_state(pci, PCI_D3hot); |
1488 | return 0; | 1489 | return 0; |
1489 | } | 1490 | } |
1490 | 1491 | ||
1491 | static int snd_atiixp_resume(struct pci_dev *pci) | 1492 | static int snd_atiixp_resume(struct device *dev) |
1492 | { | 1493 | { |
1493 | struct snd_card *card = pci_get_drvdata(pci); | 1494 | struct pci_dev *pci = to_pci_dev(dev); |
1495 | struct snd_card *card = dev_get_drvdata(dev); | ||
1494 | struct atiixp *chip = card->private_data; | 1496 | struct atiixp *chip = card->private_data; |
1495 | int i; | 1497 | int i; |
1496 | 1498 | ||
@@ -1526,6 +1528,11 @@ static int snd_atiixp_resume(struct pci_dev *pci) | |||
1526 | snd_power_change_state(card, SNDRV_CTL_POWER_D0); | 1528 | snd_power_change_state(card, SNDRV_CTL_POWER_D0); |
1527 | return 0; | 1529 | return 0; |
1528 | } | 1530 | } |
1531 | |||
1532 | static SIMPLE_DEV_PM_OPS(snd_atiixp_pm, snd_atiixp_suspend, snd_atiixp_resume); | ||
1533 | #define SND_ATIIXP_PM_OPS &snd_atiixp_pm | ||
1534 | #else | ||
1535 | #define SND_ATIIXP_PM_OPS NULL | ||
1529 | #endif /* CONFIG_PM */ | 1536 | #endif /* CONFIG_PM */ |
1530 | 1537 | ||
1531 | 1538 | ||
@@ -1705,10 +1712,9 @@ static struct pci_driver atiixp_driver = { | |||
1705 | .id_table = snd_atiixp_ids, | 1712 | .id_table = snd_atiixp_ids, |
1706 | .probe = snd_atiixp_probe, | 1713 | .probe = snd_atiixp_probe, |
1707 | .remove = __devexit_p(snd_atiixp_remove), | 1714 | .remove = __devexit_p(snd_atiixp_remove), |
1708 | #ifdef CONFIG_PM | 1715 | .driver = { |
1709 | .suspend = snd_atiixp_suspend, | 1716 | .pm = SND_ATIIXP_PM_OPS, |
1710 | .resume = snd_atiixp_resume, | 1717 | }, |
1711 | #endif | ||
1712 | }; | 1718 | }; |
1713 | 1719 | ||
1714 | module_pci_driver(atiixp_driver); | 1720 | module_pci_driver(atiixp_driver); |