diff options
author | Takashi Iwai <tiwai@suse.de> | 2015-01-08 06:45:55 -0500 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2015-01-09 10:24:20 -0500 |
commit | 7247aabd5ace16677681f815cc34f84ef0278261 (patch) | |
tree | 1c4190dabaca04fc5ef0206945fc569eec72a863 | |
parent | b8375122b59b1362e94ccd8502cff3cfef4cf168 (diff) |
ALSA: ctxfi: 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/ctxfi/cthw20k1.c | 9 | ||||
-rw-r--r-- | sound/pci/ctxfi/cthw20k2.c | 12 |
2 files changed, 0 insertions, 21 deletions
diff --git a/sound/pci/ctxfi/cthw20k1.c b/sound/pci/ctxfi/cthw20k1.c index b425aa8ee578..f16bec129c0a 100644 --- a/sound/pci/ctxfi/cthw20k1.c +++ b/sound/pci/ctxfi/cthw20k1.c | |||
@@ -2099,20 +2099,11 @@ static int hw_suspend(struct hw *hw) | |||
2099 | pci_write_config_dword(pci, UAA_CFG_SPACE_FLAG, 0x0); | 2099 | pci_write_config_dword(pci, UAA_CFG_SPACE_FLAG, 0x0); |
2100 | } | 2100 | } |
2101 | 2101 | ||
2102 | pci_disable_device(pci); | ||
2103 | pci_save_state(pci); | ||
2104 | pci_set_power_state(pci, PCI_D3hot); | ||
2105 | |||
2106 | return 0; | 2102 | return 0; |
2107 | } | 2103 | } |
2108 | 2104 | ||
2109 | static int hw_resume(struct hw *hw, struct card_conf *info) | 2105 | static int hw_resume(struct hw *hw, struct card_conf *info) |
2110 | { | 2106 | { |
2111 | struct pci_dev *pci = hw->pci; | ||
2112 | |||
2113 | pci_set_power_state(pci, PCI_D0); | ||
2114 | pci_restore_state(pci); | ||
2115 | |||
2116 | /* Re-initialize card hardware. */ | 2107 | /* Re-initialize card hardware. */ |
2117 | return hw_card_init(hw, info); | 2108 | return hw_card_init(hw, info); |
2118 | } | 2109 | } |
diff --git a/sound/pci/ctxfi/cthw20k2.c b/sound/pci/ctxfi/cthw20k2.c index 253899d13790..613671d330b1 100644 --- a/sound/pci/ctxfi/cthw20k2.c +++ b/sound/pci/ctxfi/cthw20k2.c | |||
@@ -2209,24 +2209,12 @@ static int hw_card_init(struct hw *hw, struct card_conf *info) | |||
2209 | #ifdef CONFIG_PM_SLEEP | 2209 | #ifdef CONFIG_PM_SLEEP |
2210 | static int hw_suspend(struct hw *hw) | 2210 | static int hw_suspend(struct hw *hw) |
2211 | { | 2211 | { |
2212 | struct pci_dev *pci = hw->pci; | ||
2213 | |||
2214 | hw_card_stop(hw); | 2212 | hw_card_stop(hw); |
2215 | |||
2216 | pci_disable_device(pci); | ||
2217 | pci_save_state(pci); | ||
2218 | pci_set_power_state(pci, PCI_D3hot); | ||
2219 | |||
2220 | return 0; | 2213 | return 0; |
2221 | } | 2214 | } |
2222 | 2215 | ||
2223 | static int hw_resume(struct hw *hw, struct card_conf *info) | 2216 | static int hw_resume(struct hw *hw, struct card_conf *info) |
2224 | { | 2217 | { |
2225 | struct pci_dev *pci = hw->pci; | ||
2226 | |||
2227 | pci_set_power_state(pci, PCI_D0); | ||
2228 | pci_restore_state(pci); | ||
2229 | |||
2230 | /* Re-initialize card hardware. */ | 2218 | /* Re-initialize card hardware. */ |
2231 | return hw_card_init(hw, info); | 2219 | return hw_card_init(hw, info); |
2232 | } | 2220 | } |