summaryrefslogtreecommitdiffstats
path: root/sound/pci/sis7019.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2012-07-02 15:20:37 +0200
committerTakashi Iwai <tiwai@suse.de>2012-07-03 08:23:03 +0200
commit68cb2b559278858ef9f3a7722f95df88797c7840 (patch)
tree3dd568aac5e1004ffd1e8400aa5a50ca6a11ad01 /sound/pci/sis7019.c
parent284e7ca75f96a18f182cce38ba76ee724fb97e16 (diff)
downloadop-kernel-dev-68cb2b559278858ef9f3a7722f95df88797c7840.zip
op-kernel-dev-68cb2b559278858ef9f3a7722f95df88797c7840.tar.gz
ALSA: Convert to new pm_ops for PCI drivers
Straightforward conversion to the new pm_ops from the legacy suspend/resume ops. Since we change vx222, vx_core and vxpocket have to be converted, too. Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/sis7019.c')
-rw-r--r--sound/pci/sis7019.c25
1 files changed, 15 insertions, 10 deletions
diff --git a/sound/pci/sis7019.c b/sound/pci/sis7019.c
index 1552642..512434e 100644
--- a/sound/pci/sis7019.c
+++ b/sound/pci/sis7019.c
@@ -1209,9 +1209,10 @@ static int sis_chip_init(struct sis7019 *sis)
}
#ifdef CONFIG_PM
-static int sis_suspend(struct pci_dev *pci, pm_message_t state)
+static int sis_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 sis7019 *sis = card->private_data;
void __iomem *ioaddr = sis->ioaddr;
int i;
@@ -1241,13 +1242,14 @@ static int sis_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 sis_resume(struct pci_dev *pci)
+static int sis_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 sis7019 *sis = card->private_data;
void __iomem *ioaddr = sis->ioaddr;
int i;
@@ -1298,6 +1300,11 @@ error:
snd_card_disconnect(card);
return -EIO;
}
+
+static SIMPLE_DEV_PM_OPS(sis_pm, sis_suspend, sis_resume);
+#define SIS_PM_OPS &sis_pm
+#else
+#define SIS_PM_OPS NULL
#endif /* CONFIG_PM */
static int sis_alloc_suspend(struct sis7019 *sis)
@@ -1481,11 +1488,9 @@ static struct pci_driver sis7019_driver = {
.id_table = snd_sis7019_ids,
.probe = snd_sis7019_probe,
.remove = __devexit_p(snd_sis7019_remove),
-
-#ifdef CONFIG_PM
- .suspend = sis_suspend,
- .resume = sis_resume,
-#endif
+ .driver = {
+ .pm = SIS_PM_OPS,
+ },
};
module_pci_driver(sis7019_driver);
OpenPOWER on IntegriCloud