summaryrefslogtreecommitdiff
path: root/sound/pci/maestro3.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2012-07-19 10:21:40 +0400
committerTakashi Iwai <tiwai@suse.de>2012-07-19 10:21:57 +0400
commit1558eb838ff502faafacf26b6a711dbaae796009 (patch)
tree8049ea20a214033369725ed58b8b4a3ca4110887 /sound/pci/maestro3.c
parent4609ed6b1f0ab9f11a9d0361573b53d9d057c440 (diff)
parent81fcb170852d58d7ebd8101a8ef970c82056426e (diff)
downloadlinux-1558eb838ff502faafacf26b6a711dbaae796009.tar.xz
Merge branch 'topic/pm-convert' into for-next
This merges the changes for converting to new PM ops for platform and some other drivers. Also move some header files to local places from the public include/sound.
Diffstat (limited to 'sound/pci/maestro3.c')
-rw-r--r--sound/pci/maestro3.c24
1 files changed, 15 insertions, 9 deletions
diff --git a/sound/pci/maestro3.c b/sound/pci/maestro3.c
index adb3b4c7917e..c85d1ffcc955 100644
--- a/sound/pci/maestro3.c
+++ b/sound/pci/maestro3.c
@@ -2391,9 +2391,10 @@ static int snd_m3_free(struct snd_m3 *chip)
* APM support
*/
#ifdef CONFIG_PM
-static int m3_suspend(struct pci_dev *pci, pm_message_t state)
+static int m3_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 snd_m3 *chip = card->private_data;
int i, dsp_index;
@@ -2421,13 +2422,14 @@ static int m3_suspend(struct pci_dev *pci, pm_message_t state)
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 m3_resume(struct pci_dev *pci)
+static int m3_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 snd_m3 *chip = card->private_data;
int i, dsp_index;
@@ -2478,6 +2480,11 @@ static int m3_resume(struct pci_dev *pci)
chip->in_suspend = 0;
return 0;
}
+
+static SIMPLE_DEV_PM_OPS(m3_pm, m3_suspend, m3_resume);
+#define M3_PM_OPS &m3_pm
+#else
+#define M3_PM_OPS NULL
#endif /* CONFIG_PM */
#ifdef CONFIG_SND_MAESTRO3_INPUT
@@ -2774,10 +2781,9 @@ static struct pci_driver m3_driver = {
.id_table = snd_m3_ids,
.probe = snd_m3_probe,
.remove = __devexit_p(snd_m3_remove),
-#ifdef CONFIG_PM
- .suspend = m3_suspend,
- .resume = m3_resume,
-#endif
+ .driver = {
+ .pm = M3_PM_OPS,
+ },
};
module_pci_driver(m3_driver);