diff options
author | Takashi Iwai <tiwai@suse.de> | 2015-01-08 06:45:32 -0500 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2015-01-09 10:24:20 -0500 |
commit | 319184680d7ecbea5718fa1ab73105ef8abb478f (patch) | |
tree | 39c41dfbc3639047037a370df46812cf8b5998ea | |
parent | faab5223930114b0a33f8c712c14799967342e8c (diff) |
ALSA: cs46xx: 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/cs46xx/cs46xx_lib.c | 15 |
1 files changed, 0 insertions, 15 deletions
diff --git a/sound/pci/cs46xx/cs46xx_lib.c b/sound/pci/cs46xx/cs46xx_lib.c index 32b44f25b5c8..ba97aba8d87e 100644 --- a/sound/pci/cs46xx/cs46xx_lib.c +++ b/sound/pci/cs46xx/cs46xx_lib.c | |||
@@ -3804,7 +3804,6 @@ static unsigned int saved_regs[] = { | |||
3804 | 3804 | ||
3805 | static int snd_cs46xx_suspend(struct device *dev) | 3805 | static int snd_cs46xx_suspend(struct device *dev) |
3806 | { | 3806 | { |
3807 | struct pci_dev *pci = to_pci_dev(dev); | ||
3808 | struct snd_card *card = dev_get_drvdata(dev); | 3807 | struct snd_card *card = dev_get_drvdata(dev); |
3809 | struct snd_cs46xx *chip = card->private_data; | 3808 | struct snd_cs46xx *chip = card->private_data; |
3810 | int i, amp_saved; | 3809 | int i, amp_saved; |
@@ -3829,16 +3828,11 @@ static int snd_cs46xx_suspend(struct device *dev) | |||
3829 | /* disable CLKRUN */ | 3828 | /* disable CLKRUN */ |
3830 | chip->active_ctrl(chip, -chip->amplifier); | 3829 | chip->active_ctrl(chip, -chip->amplifier); |
3831 | chip->amplifier = amp_saved; /* restore the status */ | 3830 | chip->amplifier = amp_saved; /* restore the status */ |
3832 | |||
3833 | pci_disable_device(pci); | ||
3834 | pci_save_state(pci); | ||
3835 | pci_set_power_state(pci, PCI_D3hot); | ||
3836 | return 0; | 3831 | return 0; |
3837 | } | 3832 | } |
3838 | 3833 | ||
3839 | static int snd_cs46xx_resume(struct device *dev) | 3834 | static int snd_cs46xx_resume(struct device *dev) |
3840 | { | 3835 | { |
3841 | struct pci_dev *pci = to_pci_dev(dev); | ||
3842 | struct snd_card *card = dev_get_drvdata(dev); | 3836 | struct snd_card *card = dev_get_drvdata(dev); |
3843 | struct snd_cs46xx *chip = card->private_data; | 3837 | struct snd_cs46xx *chip = card->private_data; |
3844 | int amp_saved; | 3838 | int amp_saved; |
@@ -3847,15 +3841,6 @@ static int snd_cs46xx_resume(struct device *dev) | |||
3847 | #endif | 3841 | #endif |
3848 | unsigned int tmp; | 3842 | unsigned int tmp; |
3849 | 3843 | ||
3850 | pci_set_power_state(pci, PCI_D0); | ||
3851 | pci_restore_state(pci); | ||
3852 | if (pci_enable_device(pci) < 0) { | ||
3853 | dev_err(dev, "pci_enable_device failed, disabling device\n"); | ||
3854 | snd_card_disconnect(card); | ||
3855 | return -EIO; | ||
3856 | } | ||
3857 | pci_set_master(pci); | ||
3858 | |||
3859 | amp_saved = chip->amplifier; | 3844 | amp_saved = chip->amplifier; |
3860 | chip->amplifier = 0; | 3845 | chip->amplifier = 0; |
3861 | chip->active_ctrl(chip, 1); /* force to on */ | 3846 | chip->active_ctrl(chip, 1); /* force to on */ |