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/es1938.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/es1938.c')
-rw-r--r-- | sound/pci/es1938.c | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/sound/pci/es1938.c b/sound/pci/es1938.c index 82c8d8c5c52a..227dff70069f 100644 --- a/sound/pci/es1938.c +++ b/sound/pci/es1938.c | |||
@@ -1474,9 +1474,10 @@ static unsigned char saved_regs[SAVED_REG_SIZE+1] = { | |||
1474 | }; | 1474 | }; |
1475 | 1475 | ||
1476 | 1476 | ||
1477 | static int es1938_suspend(struct pci_dev *pci, pm_message_t state) | 1477 | static int es1938_suspend(struct device *dev) |
1478 | { | 1478 | { |
1479 | struct snd_card *card = pci_get_drvdata(pci); | 1479 | struct pci_dev *pci = to_pci_dev(dev); |
1480 | struct snd_card *card = dev_get_drvdata(dev); | ||
1480 | struct es1938 *chip = card->private_data; | 1481 | struct es1938 *chip = card->private_data; |
1481 | unsigned char *s, *d; | 1482 | unsigned char *s, *d; |
1482 | 1483 | ||
@@ -1494,13 +1495,14 @@ static int es1938_suspend(struct pci_dev *pci, pm_message_t state) | |||
1494 | } | 1495 | } |
1495 | pci_disable_device(pci); | 1496 | pci_disable_device(pci); |
1496 | pci_save_state(pci); | 1497 | pci_save_state(pci); |
1497 | pci_set_power_state(pci, pci_choose_state(pci, state)); | 1498 | pci_set_power_state(pci, PCI_D3hot); |
1498 | return 0; | 1499 | return 0; |
1499 | } | 1500 | } |
1500 | 1501 | ||
1501 | static int es1938_resume(struct pci_dev *pci) | 1502 | static int es1938_resume(struct device *dev) |
1502 | { | 1503 | { |
1503 | struct snd_card *card = pci_get_drvdata(pci); | 1504 | struct pci_dev *pci = to_pci_dev(dev); |
1505 | struct snd_card *card = dev_get_drvdata(dev); | ||
1504 | struct es1938 *chip = card->private_data; | 1506 | struct es1938 *chip = card->private_data; |
1505 | unsigned char *s, *d; | 1507 | unsigned char *s, *d; |
1506 | 1508 | ||
@@ -1534,6 +1536,11 @@ static int es1938_resume(struct pci_dev *pci) | |||
1534 | snd_power_change_state(card, SNDRV_CTL_POWER_D0); | 1536 | snd_power_change_state(card, SNDRV_CTL_POWER_D0); |
1535 | return 0; | 1537 | return 0; |
1536 | } | 1538 | } |
1539 | |||
1540 | static SIMPLE_DEV_PM_OPS(es1938_pm, es1938_suspend, es1938_resume); | ||
1541 | #define ES1938_PM_OPS &es1938_pm | ||
1542 | #else | ||
1543 | #define ES1938_PM_OPS NULL | ||
1537 | #endif /* CONFIG_PM */ | 1544 | #endif /* CONFIG_PM */ |
1538 | 1545 | ||
1539 | #ifdef SUPPORT_JOYSTICK | 1546 | #ifdef SUPPORT_JOYSTICK |
@@ -1887,10 +1894,9 @@ static struct pci_driver es1938_driver = { | |||
1887 | .id_table = snd_es1938_ids, | 1894 | .id_table = snd_es1938_ids, |
1888 | .probe = snd_es1938_probe, | 1895 | .probe = snd_es1938_probe, |
1889 | .remove = __devexit_p(snd_es1938_remove), | 1896 | .remove = __devexit_p(snd_es1938_remove), |
1890 | #ifdef CONFIG_PM | 1897 | .driver = { |
1891 | .suspend = es1938_suspend, | 1898 | .pm = ES1938_PM_OPS, |
1892 | .resume = es1938_resume, | 1899 | }, |
1893 | #endif | ||
1894 | }; | 1900 | }; |
1895 | 1901 | ||
1896 | module_pci_driver(es1938_driver); | 1902 | module_pci_driver(es1938_driver); |