ALSA: sis7019: Simplify PM callbacks

This is a similar cleanup like the commit [3db084fd0af5: ALSA: fm801:
PCI core handles power state for us].

Since pci_set_power_state(), pci_save_state() and pci_restore_state()
are already done in the PCI core side, so we don't need to it doubly.

Also, pci_enable_device(), pci_disable_device() and pci_set_master()
calls in PM callbacks are superfluous nowadays, too, so get rid of
them as well.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
Takashi Iwai 2015-01-08 12:50:09 +01:00
Родитель a0044463da
Коммит 5b3985ecdc
1 изменённых файлов: 0 добавлений и 13 удалений

Просмотреть файл

@ -1211,7 +1211,6 @@ static int sis_chip_init(struct sis7019 *sis)
#ifdef CONFIG_PM_SLEEP #ifdef CONFIG_PM_SLEEP
static int sis_suspend(struct device *dev) static int sis_suspend(struct device *dev)
{ {
struct pci_dev *pci = to_pci_dev(dev);
struct snd_card *card = dev_get_drvdata(dev); struct snd_card *card = dev_get_drvdata(dev);
struct sis7019 *sis = card->private_data; struct sis7019 *sis = card->private_data;
void __iomem *ioaddr = sis->ioaddr; void __iomem *ioaddr = sis->ioaddr;
@ -1240,9 +1239,6 @@ static int sis_suspend(struct device *dev)
ioaddr += 4096; ioaddr += 4096;
} }
pci_disable_device(pci);
pci_save_state(pci);
pci_set_power_state(pci, PCI_D3hot);
return 0; return 0;
} }
@ -1254,14 +1250,6 @@ static int sis_resume(struct device *dev)
void __iomem *ioaddr = sis->ioaddr; void __iomem *ioaddr = sis->ioaddr;
int i; int i;
pci_set_power_state(pci, PCI_D0);
pci_restore_state(pci);
if (pci_enable_device(pci) < 0) {
dev_err(&pci->dev, "unable to re-enable device\n");
goto error;
}
if (sis_chip_init(sis)) { if (sis_chip_init(sis)) {
dev_err(&pci->dev, "unable to re-init controller\n"); dev_err(&pci->dev, "unable to re-init controller\n");
goto error; goto error;
@ -1284,7 +1272,6 @@ static int sis_resume(struct device *dev)
memset(sis->suspend_state[0], 0, 4096); memset(sis->suspend_state[0], 0, 4096);
sis->irq = pci->irq; sis->irq = pci->irq;
pci_set_master(pci);
if (sis->codecs_present & SIS_PRIMARY_CODEC_PRESENT) if (sis->codecs_present & SIS_PRIMARY_CODEC_PRESENT)
snd_ac97_resume(sis->ac97[0]); snd_ac97_resume(sis->ac97[0]);