summaryrefslogtreecommitdiffstats
path: root/sound/pci/rme96.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2014-02-25 09:01:15 -0500
committerTakashi Iwai <tiwai@suse.de>2014-02-26 10:45:10 -0500
commita932be91f2200cfea8bbea2d71039c715eedca2a (patch)
tree596bc704270a9c426a0ed52c14bc939886721acf /sound/pci/rme96.c
parentbf68665d7a5647591258c120382fd64465db7d63 (diff)
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: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/rme96.c')
-rw-r--r--sound/pci/rme96.c34
1 files changed, 18 insertions, 16 deletions
diff --git a/sound/pci/rme96.c b/sound/pci/rme96.c
index 00d46116e04a..f5014a8e69ad 100644
--- a/sound/pci/rme96.c
+++ b/sound/pci/rme96.c
@@ -240,7 +240,7 @@ struct rme96 {
240 240
241 u8 rev; /* card revision number */ 241 u8 rev; /* card revision number */
242 242
243#ifdef CONFIG_PM 243#ifdef CONFIG_PM_SLEEP
244 u32 playback_pointer; 244 u32 playback_pointer;
245 u32 capture_pointer; 245 u32 capture_pointer;
246 void *playback_suspend_buffer; 246 void *playback_suspend_buffer;
@@ -1570,7 +1570,7 @@ snd_rme96_free(void *private_data)
1570 pci_release_regions(rme96->pci); 1570 pci_release_regions(rme96->pci);
1571 rme96->port = 0; 1571 rme96->port = 0;
1572 } 1572 }
1573#ifdef CONFIG_PM 1573#ifdef CONFIG_PM_SLEEP
1574 vfree(rme96->playback_suspend_buffer); 1574 vfree(rme96->playback_suspend_buffer);
1575 vfree(rme96->capture_suspend_buffer); 1575 vfree(rme96->capture_suspend_buffer);
1576#endif 1576#endif
@@ -2372,13 +2372,12 @@ snd_rme96_create_switches(struct snd_card *card,
2372 * Card initialisation 2372 * Card initialisation
2373 */ 2373 */
2374 2374
2375#ifdef CONFIG_PM 2375#ifdef CONFIG_PM_SLEEP
2376 2376
2377static int 2377static int rme96_suspend(struct device *dev)
2378snd_rme96_suspend(struct pci_dev *pci,
2379 pm_message_t state)
2380{ 2378{
2381 struct snd_card *card = pci_get_drvdata(pci); 2379 struct pci_dev *pci = to_pci_dev(dev);
2380 struct snd_card *card = dev_get_drvdata(dev);
2382 struct rme96 *rme96 = card->private_data; 2381 struct rme96 *rme96 = card->private_data;
2383 2382
2384 snd_power_change_state(card, SNDRV_CTL_POWER_D3hot); 2383 snd_power_change_state(card, SNDRV_CTL_POWER_D3hot);
@@ -2407,10 +2406,10 @@ snd_rme96_suspend(struct pci_dev *pci,
2407 return 0; 2406 return 0;
2408} 2407}
2409 2408
2410static int 2409static int rme96_resume(struct device *dev)
2411snd_rme96_resume(struct pci_dev *pci)
2412{ 2410{
2413 struct snd_card *card = pci_get_drvdata(pci); 2411 struct pci_dev *pci = to_pci_dev(dev);
2412 struct snd_card *card = dev_get_drvdata(dev);
2414 struct rme96 *rme96 = card->private_data; 2413 struct rme96 *rme96 = card->private_data;
2415 2414
2416 pci_restore_state(pci); 2415 pci_restore_state(pci);
@@ -2451,7 +2450,11 @@ snd_rme96_resume(struct pci_dev *pci)
2451 return 0; 2450 return 0;
2452} 2451}
2453 2452
2454#endif 2453static SIMPLE_DEV_PM_OPS(rme96_pm, rme96_suspend, rme96_resume);
2454#define RME96_PM_OPS &rme96_pm
2455#else
2456#define RME96_PM_OPS NULL
2457#endif /* CONFIG_PM_SLEEP */
2455 2458
2456static void snd_rme96_card_free(struct snd_card *card) 2459static void snd_rme96_card_free(struct snd_card *card)
2457{ 2460{
@@ -2488,7 +2491,7 @@ snd_rme96_probe(struct pci_dev *pci,
2488 return err; 2491 return err;
2489 } 2492 }
2490 2493
2491#ifdef CONFIG_PM 2494#ifdef CONFIG_PM_SLEEP
2492 rme96->playback_suspend_buffer = vmalloc(RME96_BUFFER_SIZE); 2495 rme96->playback_suspend_buffer = vmalloc(RME96_BUFFER_SIZE);
2493 if (!rme96->playback_suspend_buffer) { 2496 if (!rme96->playback_suspend_buffer) {
2494 snd_printk(KERN_ERR 2497 snd_printk(KERN_ERR
@@ -2547,10 +2550,9 @@ static struct pci_driver rme96_driver = {
2547 .id_table = snd_rme96_ids, 2550 .id_table = snd_rme96_ids,
2548 .probe = snd_rme96_probe, 2551 .probe = snd_rme96_probe,
2549 .remove = snd_rme96_remove, 2552 .remove = snd_rme96_remove,
2550#ifdef CONFIG_PM 2553 .driver = {
2551 .suspend = snd_rme96_suspend, 2554 .pm = RME96_PM_OPS,
2552 .resume = snd_rme96_resume, 2555 },
2553#endif
2554}; 2556};
2555 2557
2556module_pci_driver(rme96_driver); 2558module_pci_driver(rme96_driver);