diff options
author | Takashi Iwai <tiwai@suse.de> | 2015-01-08 06:50:27 -0500 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2015-01-09 11:28:45 -0500 |
commit | e909bfdfa9cde50099b5eef5bd4b87d92ddffc86 (patch) | |
tree | 8315d27ab41ca5702016dc69e9e174833c4876c0 | |
parent | 6f9eb021f776e7765a054090932cc9834d99c242 (diff) |
ALSA: via82xx: 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.c | 14 |
1 files changed, 0 insertions, 14 deletions
diff --git a/sound/pci/via82xx.c b/sound/pci/via82xx.c index e088467fb736..120fccbb2461 100644 --- a/sound/pci/via82xx.c +++ b/sound/pci/via82xx.c | |||
@@ -2271,7 +2271,6 @@ static int snd_via82xx_chip_init(struct via82xx *chip) | |||
2271 | */ | 2271 | */ |
2272 | static int snd_via82xx_suspend(struct device *dev) | 2272 | static int snd_via82xx_suspend(struct device *dev) |
2273 | { | 2273 | { |
2274 | struct pci_dev *pci = to_pci_dev(dev); | ||
2275 | struct snd_card *card = dev_get_drvdata(dev); | 2274 | struct snd_card *card = dev_get_drvdata(dev); |
2276 | struct via82xx *chip = card->private_data; | 2275 | struct via82xx *chip = card->private_data; |
2277 | int i; | 2276 | int i; |
@@ -2291,28 +2290,15 @@ static int snd_via82xx_suspend(struct device *dev) | |||
2291 | chip->capture_src_saved[1] = inb(chip->port + VIA_REG_CAPTURE_CHANNEL + 0x10); | 2290 | chip->capture_src_saved[1] = inb(chip->port + VIA_REG_CAPTURE_CHANNEL + 0x10); |
2292 | } | 2291 | } |
2293 | 2292 | ||
2294 | pci_disable_device(pci); | ||
2295 | pci_save_state(pci); | ||
2296 | pci_set_power_state(pci, PCI_D3hot); | ||
2297 | return 0; | 2293 | return 0; |
2298 | } | 2294 | } |
2299 | 2295 | ||
2300 | static int snd_via82xx_resume(struct device *dev) | 2296 | static int snd_via82xx_resume(struct device *dev) |
2301 | { | 2297 | { |
2302 | struct pci_dev *pci = to_pci_dev(dev); | ||
2303 | struct snd_card *card = dev_get_drvdata(dev); | 2298 | struct snd_card *card = dev_get_drvdata(dev); |
2304 | struct via82xx *chip = card->private_data; | 2299 | struct via82xx *chip = card->private_data; |
2305 | int i; | 2300 | int i; |
2306 | 2301 | ||
2307 | pci_set_power_state(pci, PCI_D0); | ||
2308 | pci_restore_state(pci); | ||
2309 | if (pci_enable_device(pci) < 0) { | ||
2310 | dev_err(dev, "pci_enable_device failed, disabling device\n"); | ||
2311 | snd_card_disconnect(card); | ||
2312 | return -EIO; | ||
2313 | } | ||
2314 | pci_set_master(pci); | ||
2315 | |||
2316 | snd_via82xx_chip_init(chip); | 2302 | snd_via82xx_chip_init(chip); |
2317 | 2303 | ||
2318 | if (chip->chip_type == TYPE_VIA686) { | 2304 | if (chip->chip_type == TYPE_VIA686) { |