diff options
author | Takashi Iwai <tiwai@suse.de> | 2012-07-02 15:20:37 +0200 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2012-07-03 08:23:03 +0200 |
commit | 68cb2b559278858ef9f3a7722f95df88797c7840 (patch) | |
tree | 3dd568aac5e1004ffd1e8400aa5a50ca6a11ad01 /sound/pci/trident | |
parent | 284e7ca75f96a18f182cce38ba76ee724fb97e16 (diff) | |
download | linux-3.10-68cb2b559278858ef9f3a7722f95df88797c7840.tar.gz linux-3.10-68cb2b559278858ef9f3a7722f95df88797c7840.tar.bz2 linux-3.10-68cb2b559278858ef9f3a7722f95df88797c7840.zip |
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/trident')
-rw-r--r-- | sound/pci/trident/trident.c | 5 | ||||
-rw-r--r-- | sound/pci/trident/trident_main.c | 14 |
2 files changed, 12 insertions, 7 deletions
diff --git a/sound/pci/trident/trident.c b/sound/pci/trident/trident.c index 611983ec732..f61346a555b 100644 --- a/sound/pci/trident/trident.c +++ b/sound/pci/trident/trident.c @@ -178,8 +178,9 @@ static struct pci_driver trident_driver = { .probe = snd_trident_probe, .remove = __devexit_p(snd_trident_remove), #ifdef CONFIG_PM - .suspend = snd_trident_suspend, - .resume = snd_trident_resume, + .driver = { + .pm = &snd_trident_pm, + }, #endif }; diff --git a/sound/pci/trident/trident_main.c b/sound/pci/trident/trident_main.c index 61d3c0e8d4c..b4430c093ba 100644 --- a/sound/pci/trident/trident_main.c +++ b/sound/pci/trident/trident_main.c @@ -3920,9 +3920,10 @@ static void snd_trident_clear_voices(struct snd_trident * trident, unsigned shor } #ifdef CONFIG_PM -int snd_trident_suspend(struct pci_dev *pci, pm_message_t state) +static int snd_trident_suspend(struct device *dev) { - struct snd_card *card = pci_get_drvdata(pci); + struct pci_dev *pci = to_pci_dev(dev); + struct snd_card *card = dev_get_drvdata(dev); struct snd_trident *trident = card->private_data; trident->in_suspend = 1; @@ -3936,13 +3937,14 @@ int snd_trident_suspend(struct pci_dev *pci, pm_message_t state) pci_disable_device(pci); pci_save_state(pci); - pci_set_power_state(pci, pci_choose_state(pci, state)); + pci_set_power_state(pci, PCI_D3hot); return 0; } -int snd_trident_resume(struct pci_dev *pci) +static int snd_trident_resume(struct device *dev) { - struct snd_card *card = pci_get_drvdata(pci); + struct pci_dev *pci = to_pci_dev(dev); + struct snd_card *card = dev_get_drvdata(dev); struct snd_trident *trident = card->private_data; pci_set_power_state(pci, PCI_D0); @@ -3979,4 +3981,6 @@ int snd_trident_resume(struct pci_dev *pci) trident->in_suspend = 0; return 0; } + +SIMPLE_DEV_PM_OPS(snd_trident_pm, snd_trident_suspend, snd_trident_resume); #endif /* CONFIG_PM */ |