u8 rev; /* card revision number */
-#ifdef CONFIG_PM
+#ifdef CONFIG_PM_SLEEP
u32 playback_pointer;
u32 capture_pointer;
void *playback_suspend_buffer;
pci_release_regions(rme96->pci);
rme96->port = 0;
}
-#ifdef CONFIG_PM
+#ifdef CONFIG_PM_SLEEP
vfree(rme96->playback_suspend_buffer);
vfree(rme96->capture_suspend_buffer);
#endif
* Card initialisation
*/
-#ifdef CONFIG_PM
+#ifdef CONFIG_PM_SLEEP
-static int
-snd_rme96_suspend(struct pci_dev *pci,
- pm_message_t state)
+static int rme96_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 rme96 *rme96 = card->private_data;
snd_power_change_state(card, SNDRV_CTL_POWER_D3hot);
return 0;
}
-static int
-snd_rme96_resume(struct pci_dev *pci)
+static int rme96_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 rme96 *rme96 = card->private_data;
pci_restore_state(pci);
return 0;
}
-#endif
+static SIMPLE_DEV_PM_OPS(rme96_pm, rme96_suspend, rme96_resume);
+#define RME96_PM_OPS &rme96_pm
+#else
+#define RME96_PM_OPS NULL
+#endif /* CONFIG_PM_SLEEP */
static void snd_rme96_card_free(struct snd_card *card)
{
return err;
}
-#ifdef CONFIG_PM
+#ifdef CONFIG_PM_SLEEP
rme96->playback_suspend_buffer = vmalloc(RME96_BUFFER_SIZE);
if (!rme96->playback_suspend_buffer) {
snd_printk(KERN_ERR
.id_table = snd_rme96_ids,
.probe = snd_rme96_probe,
.remove = snd_rme96_remove,
-#ifdef CONFIG_PM
- .suspend = snd_rme96_suspend,
- .resume = snd_rme96_resume,
-#endif
+ .driver = {
+ .pm = RME96_PM_OPS,
+ },
};
module_pci_driver(rme96_driver);