aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2015-01-08 06:50:36 -0500
committerTakashi Iwai <tiwai@suse.de>2015-01-09 11:28:46 -0500
commitc11b4c68f4e9b92536fae1f000cb734609633c63 (patch)
tree78e29ad43c3a94a08cd43a058ecc8ae4b420767c
parente909bfdfa9cde50099b5eef5bd4b87d92ddffc86 (diff)
ALSA: via82xx-modem: 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>
-rw-r--r--sound/pci/via82xx_modem.c15
1 files changed, 0 insertions, 15 deletions
diff --git a/sound/pci/via82xx_modem.c b/sound/pci/via82xx_modem.c
index fd46ffe12e4f..884f49eea495 100644
--- a/sound/pci/via82xx_modem.c
+++ b/sound/pci/via82xx_modem.c
@@ -1031,7 +1031,6 @@ static int snd_via82xx_chip_init(struct via82xx_modem *chip)
1031 */ 1031 */
1032static int snd_via82xx_suspend(struct device *dev) 1032static int snd_via82xx_suspend(struct device *dev)
1033{ 1033{
1034 struct pci_dev *pci = to_pci_dev(dev);
1035 struct snd_card *card = dev_get_drvdata(dev); 1034 struct snd_card *card = dev_get_drvdata(dev);
1036 struct via82xx_modem *chip = card->private_data; 1035 struct via82xx_modem *chip = card->private_data;
1037 int i; 1036 int i;
@@ -1043,29 +1042,15 @@ static int snd_via82xx_suspend(struct device *dev)
1043 snd_via82xx_channel_reset(chip, &chip->devs[i]); 1042 snd_via82xx_channel_reset(chip, &chip->devs[i]);
1044 synchronize_irq(chip->irq); 1043 synchronize_irq(chip->irq);
1045 snd_ac97_suspend(chip->ac97); 1044 snd_ac97_suspend(chip->ac97);
1046
1047 pci_disable_device(pci);
1048 pci_save_state(pci);
1049 pci_set_power_state(pci, PCI_D3hot);
1050 return 0; 1045 return 0;
1051} 1046}
1052 1047
1053static int snd_via82xx_resume(struct device *dev) 1048static int snd_via82xx_resume(struct device *dev)
1054{ 1049{
1055 struct pci_dev *pci = to_pci_dev(dev);
1056 struct snd_card *card = dev_get_drvdata(dev); 1050 struct snd_card *card = dev_get_drvdata(dev);
1057 struct via82xx_modem *chip = card->private_data; 1051 struct via82xx_modem *chip = card->private_data;
1058 int i; 1052 int i;
1059 1053
1060 pci_set_power_state(pci, PCI_D0);
1061 pci_restore_state(pci);
1062 if (pci_enable_device(pci) < 0) {
1063 dev_err(dev, "pci_enable_device failed, disabling device\n");
1064 snd_card_disconnect(card);
1065 return -EIO;
1066 }
1067 pci_set_master(pci);
1068
1069 snd_via82xx_chip_init(chip); 1054 snd_via82xx_chip_init(chip);
1070 1055
1071 snd_ac97_resume(chip->ac97); 1056 snd_ac97_resume(chip->ac97);