diff options
author | Takashi Iwai <tiwai@suse.de> | 2015-01-08 06:44:18 -0500 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2015-01-09 10:24:18 -0500 |
commit | 94af14691d3783629f5d186acfb1f700fb68ff03 (patch) | |
tree | 2bf85833a62ed243b759b639d60af1384d6a59a0 /sound/pci/atiixp.c | |
parent | dc3b10eb64edd977fb5173f72fc66cc8687e61be (diff) |
ALSA: atiixp: 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>
Diffstat (limited to 'sound/pci/atiixp.c')
-rw-r--r-- | sound/pci/atiixp.c | 15 |
1 files changed, 0 insertions, 15 deletions
diff --git a/sound/pci/atiixp.c b/sound/pci/atiixp.c index 9c1c4452a8ee..f41de00d974c 100644 --- a/sound/pci/atiixp.c +++ b/sound/pci/atiixp.c | |||
@@ -1474,7 +1474,6 @@ static int snd_atiixp_mixer_new(struct atiixp *chip, int clock, | |||
1474 | */ | 1474 | */ |
1475 | static int snd_atiixp_suspend(struct device *dev) | 1475 | static int snd_atiixp_suspend(struct device *dev) |
1476 | { | 1476 | { |
1477 | struct pci_dev *pci = to_pci_dev(dev); | ||
1478 | struct snd_card *card = dev_get_drvdata(dev); | 1477 | struct snd_card *card = dev_get_drvdata(dev); |
1479 | struct atiixp *chip = card->private_data; | 1478 | struct atiixp *chip = card->private_data; |
1480 | int i; | 1479 | int i; |
@@ -1492,29 +1491,15 @@ static int snd_atiixp_suspend(struct device *dev) | |||
1492 | snd_ac97_suspend(chip->ac97[i]); | 1491 | snd_ac97_suspend(chip->ac97[i]); |
1493 | snd_atiixp_aclink_down(chip); | 1492 | snd_atiixp_aclink_down(chip); |
1494 | snd_atiixp_chip_stop(chip); | 1493 | snd_atiixp_chip_stop(chip); |
1495 | |||
1496 | pci_disable_device(pci); | ||
1497 | pci_save_state(pci); | ||
1498 | pci_set_power_state(pci, PCI_D3hot); | ||
1499 | return 0; | 1494 | return 0; |
1500 | } | 1495 | } |
1501 | 1496 | ||
1502 | static int snd_atiixp_resume(struct device *dev) | 1497 | static int snd_atiixp_resume(struct device *dev) |
1503 | { | 1498 | { |
1504 | struct pci_dev *pci = to_pci_dev(dev); | ||
1505 | struct snd_card *card = dev_get_drvdata(dev); | 1499 | struct snd_card *card = dev_get_drvdata(dev); |
1506 | struct atiixp *chip = card->private_data; | 1500 | struct atiixp *chip = card->private_data; |
1507 | int i; | 1501 | int i; |
1508 | 1502 | ||
1509 | pci_set_power_state(pci, PCI_D0); | ||
1510 | pci_restore_state(pci); | ||
1511 | if (pci_enable_device(pci) < 0) { | ||
1512 | dev_err(dev, "pci_enable_device failed, disabling device\n"); | ||
1513 | snd_card_disconnect(card); | ||
1514 | return -EIO; | ||
1515 | } | ||
1516 | pci_set_master(pci); | ||
1517 | |||
1518 | snd_atiixp_aclink_reset(chip); | 1503 | snd_atiixp_aclink_reset(chip); |
1519 | snd_atiixp_chip_start(chip); | 1504 | snd_atiixp_chip_start(chip); |
1520 | 1505 | ||