ALSA: ctxfi: Simplify PM callbacks
authorTakashi Iwai <tiwai@suse.de>
Thu, 8 Jan 2015 11:45:55 +0000 (12:45 +0100)
committerTakashi Iwai <tiwai@suse.de>
Fri, 9 Jan 2015 15:24:20 +0000 (16:24 +0100)
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>
sound/pci/ctxfi/cthw20k1.c
sound/pci/ctxfi/cthw20k2.c

index b425aa8ee57858fb11c43f5c1b56bfa6adc8bbca..f16bec129c0a44a09fd72a5a15105810a7086a2e 100644 (file)
@@ -2099,20 +2099,11 @@ static int hw_suspend(struct hw *hw)
                pci_write_config_dword(pci, UAA_CFG_SPACE_FLAG, 0x0);
        }
 
-       pci_disable_device(pci);
-       pci_save_state(pci);
-       pci_set_power_state(pci, PCI_D3hot);
-
        return 0;
 }
 
 static int hw_resume(struct hw *hw, struct card_conf *info)
 {
-       struct pci_dev *pci = hw->pci;
-
-       pci_set_power_state(pci, PCI_D0);
-       pci_restore_state(pci);
-
        /* Re-initialize card hardware. */
        return hw_card_init(hw, info);
 }
index 253899d1379096ea3108c5588aa012b3e4bd9a80..613671d330b1c1d94810b6249b90a9a89774690c 100644 (file)
@@ -2209,24 +2209,12 @@ static int hw_card_init(struct hw *hw, struct card_conf *info)
 #ifdef CONFIG_PM_SLEEP
 static int hw_suspend(struct hw *hw)
 {
-       struct pci_dev *pci = hw->pci;
-
        hw_card_stop(hw);
-
-       pci_disable_device(pci);
-       pci_save_state(pci);
-       pci_set_power_state(pci, PCI_D3hot);
-
        return 0;
 }
 
 static int hw_resume(struct hw *hw, struct card_conf *info)
 {
-       struct pci_dev *pci = hw->pci;
-
-       pci_set_power_state(pci, PCI_D0);
-       pci_restore_state(pci);
-
        /* Re-initialize card hardware. */
        return hw_card_init(hw, info);
 }