Commit a932be91 authored by Takashi Iwai's avatar Takashi Iwai

ALSA: rme96: Convert to the new pm_ops

This driver slipped from the last rewrite.  Just convert to the new
standard pm ops.
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent bf68665d
...@@ -240,7 +240,7 @@ struct rme96 { ...@@ -240,7 +240,7 @@ struct rme96 {
u8 rev; /* card revision number */ u8 rev; /* card revision number */
#ifdef CONFIG_PM #ifdef CONFIG_PM_SLEEP
u32 playback_pointer; u32 playback_pointer;
u32 capture_pointer; u32 capture_pointer;
void *playback_suspend_buffer; void *playback_suspend_buffer;
...@@ -1570,7 +1570,7 @@ snd_rme96_free(void *private_data) ...@@ -1570,7 +1570,7 @@ snd_rme96_free(void *private_data)
pci_release_regions(rme96->pci); pci_release_regions(rme96->pci);
rme96->port = 0; rme96->port = 0;
} }
#ifdef CONFIG_PM #ifdef CONFIG_PM_SLEEP
vfree(rme96->playback_suspend_buffer); vfree(rme96->playback_suspend_buffer);
vfree(rme96->capture_suspend_buffer); vfree(rme96->capture_suspend_buffer);
#endif #endif
...@@ -2372,13 +2372,12 @@ snd_rme96_create_switches(struct snd_card *card, ...@@ -2372,13 +2372,12 @@ snd_rme96_create_switches(struct snd_card *card,
* Card initialisation * Card initialisation
*/ */
#ifdef CONFIG_PM #ifdef CONFIG_PM_SLEEP
static int static int rme96_suspend(struct device *dev)
snd_rme96_suspend(struct pci_dev *pci,
pm_message_t state)
{ {
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; struct rme96 *rme96 = card->private_data;
snd_power_change_state(card, SNDRV_CTL_POWER_D3hot); snd_power_change_state(card, SNDRV_CTL_POWER_D3hot);
...@@ -2407,10 +2406,10 @@ snd_rme96_suspend(struct pci_dev *pci, ...@@ -2407,10 +2406,10 @@ snd_rme96_suspend(struct pci_dev *pci,
return 0; return 0;
} }
static int static int rme96_resume(struct device *dev)
snd_rme96_resume(struct pci_dev *pci)
{ {
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; struct rme96 *rme96 = card->private_data;
pci_restore_state(pci); pci_restore_state(pci);
...@@ -2451,7 +2450,11 @@ snd_rme96_resume(struct pci_dev *pci) ...@@ -2451,7 +2450,11 @@ snd_rme96_resume(struct pci_dev *pci)
return 0; 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) static void snd_rme96_card_free(struct snd_card *card)
{ {
...@@ -2488,7 +2491,7 @@ snd_rme96_probe(struct pci_dev *pci, ...@@ -2488,7 +2491,7 @@ snd_rme96_probe(struct pci_dev *pci,
return err; return err;
} }
#ifdef CONFIG_PM #ifdef CONFIG_PM_SLEEP
rme96->playback_suspend_buffer = vmalloc(RME96_BUFFER_SIZE); rme96->playback_suspend_buffer = vmalloc(RME96_BUFFER_SIZE);
if (!rme96->playback_suspend_buffer) { if (!rme96->playback_suspend_buffer) {
snd_printk(KERN_ERR snd_printk(KERN_ERR
...@@ -2547,10 +2550,9 @@ static struct pci_driver rme96_driver = { ...@@ -2547,10 +2550,9 @@ static struct pci_driver rme96_driver = {
.id_table = snd_rme96_ids, .id_table = snd_rme96_ids,
.probe = snd_rme96_probe, .probe = snd_rme96_probe,
.remove = snd_rme96_remove, .remove = snd_rme96_remove,
#ifdef CONFIG_PM .driver = {
.suspend = snd_rme96_suspend, .pm = RME96_PM_OPS,
.resume = snd_rme96_resume, },
#endif
}; };
module_pci_driver(rme96_driver); module_pci_driver(rme96_driver);
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment