aboutsummaryrefslogtreecommitdiff
path: root/sound/pci/nm256/nm256.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/pci/nm256/nm256.c')
-rw-r--r--sound/pci/nm256/nm256.c24
1 files changed, 15 insertions, 9 deletions
diff --git a/sound/pci/nm256/nm256.c b/sound/pci/nm256/nm256.c
index 8159b05ee94d..465cff25b146 100644
--- a/sound/pci/nm256/nm256.c
+++ b/sound/pci/nm256/nm256.c
@@ -1382,9 +1382,10 @@ snd_nm256_peek_for_sig(struct nm256 *chip)
* APM event handler, so the card is properly reinitialized after a power
* event.
*/
-static int nm256_suspend(struct pci_dev *pci, pm_message_t state)
+static int nm256_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 nm256 *chip = card->private_data;
snd_power_change_state(card, SNDRV_CTL_POWER_D3hot);
@@ -1393,13 +1394,14 @@ static int nm256_suspend(struct pci_dev *pci, pm_message_t state)
chip->coeffs_current = 0;
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;
}
-static int nm256_resume(struct pci_dev *pci)
+static int nm256_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 nm256 *chip = card->private_data;
int i;
@@ -1434,6 +1436,11 @@ static int nm256_resume(struct pci_dev *pci)
chip->in_resume = 0;
return 0;
}
+
+static SIMPLE_DEV_PM_OPS(nm256_pm, nm256_suspend, nm256_resume);
+#define NM256_PM_OPS &nm256_pm
+#else
+#define NM256_PM_OPS NULL
#endif /* CONFIG_PM */
static int snd_nm256_free(struct nm256 *chip)
@@ -1747,10 +1754,9 @@ static struct pci_driver nm256_driver = {
.id_table = snd_nm256_ids,
.probe = snd_nm256_probe,
.remove = __devexit_p(snd_nm256_remove),
-#ifdef CONFIG_PM
- .suspend = nm256_suspend,
- .resume = nm256_resume,
-#endif
+ .driver = {
+ .pm = NM256_PM_OPS,
+ },
};
module_pci_driver(nm256_driver);