aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2015-01-08 06:40:23 -0500
committerTakashi Iwai <tiwai@suse.de>2015-01-09 10:24:17 -0500
commitc4eaa62fdac3cdbf358e19625477ffc9a15d4c7b (patch)
treeb967c3e7e089145dccf984452213aa6c872b0e0b
parent3db084fd0af5407eebeb9b7ebd5d0425b362c519 (diff)
ALSA: ali5451: 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/ali5451/ali5451.c15
1 files changed, 0 insertions, 15 deletions
diff --git a/sound/pci/ali5451/ali5451.c b/sound/pci/ali5451/ali5451.c
index af89e42b2160..4cd2210fd95c 100644
--- a/sound/pci/ali5451/ali5451.c
+++ b/sound/pci/ali5451/ali5451.c
@@ -1873,7 +1873,6 @@ static int snd_ali_mixer(struct snd_ali *codec)
1873#ifdef CONFIG_PM_SLEEP 1873#ifdef CONFIG_PM_SLEEP
1874static int ali_suspend(struct device *dev) 1874static int ali_suspend(struct device *dev)
1875{ 1875{
1876 struct pci_dev *pci = to_pci_dev(dev);
1877 struct snd_card *card = dev_get_drvdata(dev); 1876 struct snd_card *card = dev_get_drvdata(dev);
1878 struct snd_ali *chip = card->private_data; 1877 struct snd_ali *chip = card->private_data;
1879 struct snd_ali_image *im; 1878 struct snd_ali_image *im;
@@ -1914,16 +1913,11 @@ static int ali_suspend(struct device *dev)
1914 outl(0xffffffff, ALI_REG(chip, ALI_STOP)); 1913 outl(0xffffffff, ALI_REG(chip, ALI_STOP));
1915 1914
1916 spin_unlock_irq(&chip->reg_lock); 1915 spin_unlock_irq(&chip->reg_lock);
1917
1918 pci_disable_device(pci);
1919 pci_save_state(pci);
1920 pci_set_power_state(pci, PCI_D3hot);
1921 return 0; 1916 return 0;
1922} 1917}
1923 1918
1924static int ali_resume(struct device *dev) 1919static int ali_resume(struct device *dev)
1925{ 1920{
1926 struct pci_dev *pci = to_pci_dev(dev);
1927 struct snd_card *card = dev_get_drvdata(dev); 1921 struct snd_card *card = dev_get_drvdata(dev);
1928 struct snd_ali *chip = card->private_data; 1922 struct snd_ali *chip = card->private_data;
1929 struct snd_ali_image *im; 1923 struct snd_ali_image *im;
@@ -1933,15 +1927,6 @@ static int ali_resume(struct device *dev)
1933 if (!im) 1927 if (!im)
1934 return 0; 1928 return 0;
1935 1929
1936 pci_set_power_state(pci, PCI_D0);
1937 pci_restore_state(pci);
1938 if (pci_enable_device(pci) < 0) {
1939 dev_err(dev, "pci_enable_device failed, disabling device\n");
1940 snd_card_disconnect(card);
1941 return -EIO;
1942 }
1943 pci_set_master(pci);
1944
1945 spin_lock_irq(&chip->reg_lock); 1930 spin_lock_irq(&chip->reg_lock);
1946 1931
1947 for (i = 0; i < ALI_CHANNELS; i++) { 1932 for (i = 0; i < ALI_CHANNELS; i++) {