]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ALSA: echoaudio: Simplify PM callbacks
authorTakashi Iwai <tiwai@suse.de>
Thu, 8 Jan 2015 11:46:07 +0000 (12:46 +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/echoaudio/echoaudio.c

index 21228adaa70cb104b58580ec6392f129a9011708..58960841ae7c5772b21e622e88ee03502e49f4a3 100644 (file)
@@ -2162,7 +2162,6 @@ ctl_error:
 
 static int snd_echo_suspend(struct device *dev)
 {
-       struct pci_dev *pci = to_pci_dev(dev);
        struct echoaudio *chip = dev_get_drvdata(dev);
 
        snd_pcm_suspend_all(chip->analog_pcm);
@@ -2188,9 +2187,6 @@ static int snd_echo_suspend(struct device *dev)
        chip->dsp_code = NULL;
        free_irq(chip->irq, chip);
        chip->irq = -1;
-       pci_save_state(pci);
-       pci_disable_device(pci);
-
        return 0;
 }
 
@@ -2204,7 +2200,6 @@ static int snd_echo_resume(struct device *dev)
        u32 pipe_alloc_mask;
        int err;
 
-       pci_restore_state(pci);
        commpage_bak = kmalloc(sizeof(struct echoaudio), GFP_KERNEL);
        if (commpage_bak == NULL)
                return -ENOMEM;