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/trident/trident_main.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/trident/trident_main.c')
-rw-r--r-- | sound/pci/trident/trident_main.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/sound/pci/trident/trident_main.c b/sound/pci/trident/trident_main.c index 61d3c0e8d4ce..b4430c093bad 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 | |||
3920 | } | 3920 | } |
3921 | 3921 | ||
3922 | #ifdef CONFIG_PM | 3922 | #ifdef CONFIG_PM |
3923 | int snd_trident_suspend(struct pci_dev *pci, pm_message_t state) | 3923 | static int snd_trident_suspend(struct device *dev) |
3924 | { | 3924 | { |
3925 | struct snd_card *card = pci_get_drvdata(pci); | 3925 | struct pci_dev *pci = to_pci_dev(dev); |
3926 | struct snd_card *card = dev_get_drvdata(dev); | ||
3926 | struct snd_trident *trident = card->private_data; | 3927 | struct snd_trident *trident = card->private_data; |
3927 | 3928 | ||
3928 | trident->in_suspend = 1; | 3929 | trident->in_suspend = 1; |
@@ -3936,13 +3937,14 @@ int snd_trident_suspend(struct pci_dev *pci, pm_message_t state) | |||
3936 | 3937 | ||
3937 | pci_disable_device(pci); | 3938 | pci_disable_device(pci); |
3938 | pci_save_state(pci); | 3939 | pci_save_state(pci); |
3939 | pci_set_power_state(pci, pci_choose_state(pci, state)); | 3940 | pci_set_power_state(pci, PCI_D3hot); |
3940 | return 0; | 3941 | return 0; |
3941 | } | 3942 | } |
3942 | 3943 | ||
3943 | int snd_trident_resume(struct pci_dev *pci) | 3944 | static int snd_trident_resume(struct device *dev) |
3944 | { | 3945 | { |
3945 | struct snd_card *card = pci_get_drvdata(pci); | 3946 | struct pci_dev *pci = to_pci_dev(dev); |
3947 | struct snd_card *card = dev_get_drvdata(dev); | ||
3946 | struct snd_trident *trident = card->private_data; | 3948 | struct snd_trident *trident = card->private_data; |
3947 | 3949 | ||
3948 | pci_set_power_state(pci, PCI_D0); | 3950 | pci_set_power_state(pci, PCI_D0); |
@@ -3979,4 +3981,6 @@ int snd_trident_resume(struct pci_dev *pci) | |||
3979 | trident->in_suspend = 0; | 3981 | trident->in_suspend = 0; |
3980 | return 0; | 3982 | return 0; |
3981 | } | 3983 | } |
3984 | |||
3985 | SIMPLE_DEV_PM_OPS(snd_trident_pm, snd_trident_suspend, snd_trident_resume); | ||
3982 | #endif /* CONFIG_PM */ | 3986 | #endif /* CONFIG_PM */ |