diff options
author | Takashi Iwai <tiwai@suse.de> | 2015-01-08 06:50:18 -0500 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2015-01-09 11:28:45 -0500 |
commit | 6f9eb021f776e7765a054090932cc9834d99c242 (patch) | |
tree | 29bb50a0328d55194f6250381c2a0c4de4738e6d | |
parent | 5b3985ecdc6beab7db96a259fce0d8befd99ff07 (diff) |
ALSA: trident: 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/trident/trident_main.c | 15 |
1 files changed, 0 insertions, 15 deletions
diff --git a/sound/pci/trident/trident_main.c b/sound/pci/trident/trident_main.c index 57cd757acfe7..072824982ff8 100644 --- a/sound/pci/trident/trident_main.c +++ b/sound/pci/trident/trident_main.c | |||
@@ -3926,7 +3926,6 @@ static void snd_trident_clear_voices(struct snd_trident * trident, unsigned shor | |||
3926 | #ifdef CONFIG_PM_SLEEP | 3926 | #ifdef CONFIG_PM_SLEEP |
3927 | static int snd_trident_suspend(struct device *dev) | 3927 | static int snd_trident_suspend(struct device *dev) |
3928 | { | 3928 | { |
3929 | struct pci_dev *pci = to_pci_dev(dev); | ||
3930 | struct snd_card *card = dev_get_drvdata(dev); | 3929 | struct snd_card *card = dev_get_drvdata(dev); |
3931 | struct snd_trident *trident = card->private_data; | 3930 | struct snd_trident *trident = card->private_data; |
3932 | 3931 | ||
@@ -3938,28 +3937,14 @@ static int snd_trident_suspend(struct device *dev) | |||
3938 | 3937 | ||
3939 | snd_ac97_suspend(trident->ac97); | 3938 | snd_ac97_suspend(trident->ac97); |
3940 | snd_ac97_suspend(trident->ac97_sec); | 3939 | snd_ac97_suspend(trident->ac97_sec); |
3941 | |||
3942 | pci_disable_device(pci); | ||
3943 | pci_save_state(pci); | ||
3944 | pci_set_power_state(pci, PCI_D3hot); | ||
3945 | return 0; | 3940 | return 0; |
3946 | } | 3941 | } |
3947 | 3942 | ||
3948 | static int snd_trident_resume(struct device *dev) | 3943 | static int snd_trident_resume(struct device *dev) |
3949 | { | 3944 | { |
3950 | struct pci_dev *pci = to_pci_dev(dev); | ||
3951 | struct snd_card *card = dev_get_drvdata(dev); | 3945 | struct snd_card *card = dev_get_drvdata(dev); |
3952 | struct snd_trident *trident = card->private_data; | 3946 | struct snd_trident *trident = card->private_data; |
3953 | 3947 | ||
3954 | pci_set_power_state(pci, PCI_D0); | ||
3955 | pci_restore_state(pci); | ||
3956 | if (pci_enable_device(pci) < 0) { | ||
3957 | dev_err(dev, "pci_enable_device failed, disabling device\n"); | ||
3958 | snd_card_disconnect(card); | ||
3959 | return -EIO; | ||
3960 | } | ||
3961 | pci_set_master(pci); | ||
3962 | |||
3963 | switch (trident->device) { | 3948 | switch (trident->device) { |
3964 | case TRIDENT_DEVICE_ID_DX: | 3949 | case TRIDENT_DEVICE_ID_DX: |
3965 | snd_trident_4d_dx_init(trident); | 3950 | snd_trident_4d_dx_init(trident); |