summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2015-01-08 06:44:47 -0500
committerTakashi Iwai <tiwai@suse.de>2015-01-09 10:24:19 -0500
commit3a7ed36909a6c4aee677100ff1a45869a5873a12 (patch)
tree1e274011ca24fe5f20eadc6636bf0646a6622dc3
parent2b5d0891ba8555c8edc21098715324d90a4d5de0 (diff)
ALSA: azt3328: 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/azt3328.c15
1 files changed, 0 insertions, 15 deletions
diff --git a/sound/pci/azt3328.c b/sound/pci/azt3328.c
index fdbb9c05c77b..bbacc75c902a 100644
--- a/sound/pci/azt3328.c
+++ b/sound/pci/azt3328.c
@@ -2694,7 +2694,6 @@ snd_azf3328_resume_ac97(const struct snd_azf3328 *chip)
2694static int 2694static int
2695snd_azf3328_suspend(struct device *dev) 2695snd_azf3328_suspend(struct device *dev)
2696{ 2696{
2697 struct pci_dev *pci = to_pci_dev(dev);
2698 struct snd_card *card = dev_get_drvdata(dev); 2697 struct snd_card *card = dev_get_drvdata(dev);
2699 struct snd_azf3328 *chip = card->private_data; 2698 struct snd_azf3328 *chip = card->private_data;
2700 u16 *saved_regs_ctrl_u16; 2699 u16 *saved_regs_ctrl_u16;
@@ -2720,29 +2719,15 @@ snd_azf3328_suspend(struct device *dev)
2720 ARRAY_SIZE(chip->saved_regs_mpu), chip->saved_regs_mpu); 2719 ARRAY_SIZE(chip->saved_regs_mpu), chip->saved_regs_mpu);
2721 snd_azf3328_suspend_regs(chip, chip->opl3_io, 2720 snd_azf3328_suspend_regs(chip, chip->opl3_io,
2722 ARRAY_SIZE(chip->saved_regs_opl3), chip->saved_regs_opl3); 2721 ARRAY_SIZE(chip->saved_regs_opl3), chip->saved_regs_opl3);
2723
2724 pci_disable_device(pci);
2725 pci_save_state(pci);
2726 pci_set_power_state(pci, PCI_D3hot);
2727 return 0; 2722 return 0;
2728} 2723}
2729 2724
2730static int 2725static int
2731snd_azf3328_resume(struct device *dev) 2726snd_azf3328_resume(struct device *dev)
2732{ 2727{
2733 struct pci_dev *pci = to_pci_dev(dev);
2734 struct snd_card *card = dev_get_drvdata(dev); 2728 struct snd_card *card = dev_get_drvdata(dev);
2735 const struct snd_azf3328 *chip = card->private_data; 2729 const struct snd_azf3328 *chip = card->private_data;
2736 2730
2737 pci_set_power_state(pci, PCI_D0);
2738 pci_restore_state(pci);
2739 if (pci_enable_device(pci) < 0) {
2740 dev_err(dev, "pci_enable_device failed, disabling device\n");
2741 snd_card_disconnect(card);
2742 return -EIO;
2743 }
2744 pci_set_master(pci);
2745
2746 snd_azf3328_resume_regs(chip, chip->saved_regs_game, chip->game_io, 2731 snd_azf3328_resume_regs(chip, chip->saved_regs_game, chip->game_io,
2747 ARRAY_SIZE(chip->saved_regs_game)); 2732 ARRAY_SIZE(chip->saved_regs_game));
2748 snd_azf3328_resume_regs(chip, chip->saved_regs_mpu, chip->mpu_io, 2733 snd_azf3328_resume_regs(chip, chip->saved_regs_mpu, chip->mpu_io,