diff options
author | Takashi Iwai <tiwai@suse.de> | 2015-01-08 06:44:59 -0500 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2015-01-09 10:24:19 -0500 |
commit | 11afa6426c4ff69cc58f0b91e85cf17f31c0a442 (patch) | |
tree | 1016e6c3576cbe2dd7f990ec10a3ea7e9b9555ee | |
parent | 3a7ed36909a6c4aee677100ff1a45869a5873a12 (diff) |
ALSA: ca0106: 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/ca0106/ca0106_main.c | 16 |
1 files changed, 0 insertions, 16 deletions
diff --git a/sound/pci/ca0106/ca0106_main.c b/sound/pci/ca0106/ca0106_main.c index 96af33965b51..dd75b7536fa2 100644 --- a/sound/pci/ca0106/ca0106_main.c +++ b/sound/pci/ca0106/ca0106_main.c | |||
@@ -1910,7 +1910,6 @@ static void snd_ca0106_remove(struct pci_dev *pci) | |||
1910 | #ifdef CONFIG_PM_SLEEP | 1910 | #ifdef CONFIG_PM_SLEEP |
1911 | static int snd_ca0106_suspend(struct device *dev) | 1911 | static int snd_ca0106_suspend(struct device *dev) |
1912 | { | 1912 | { |
1913 | struct pci_dev *pci = to_pci_dev(dev); | ||
1914 | struct snd_card *card = dev_get_drvdata(dev); | 1913 | struct snd_card *card = dev_get_drvdata(dev); |
1915 | struct snd_ca0106 *chip = card->private_data; | 1914 | struct snd_ca0106 *chip = card->private_data; |
1916 | int i; | 1915 | int i; |
@@ -1923,30 +1922,15 @@ static int snd_ca0106_suspend(struct device *dev) | |||
1923 | snd_ca0106_mixer_suspend(chip); | 1922 | snd_ca0106_mixer_suspend(chip); |
1924 | 1923 | ||
1925 | ca0106_stop_chip(chip); | 1924 | ca0106_stop_chip(chip); |
1926 | |||
1927 | pci_disable_device(pci); | ||
1928 | pci_save_state(pci); | ||
1929 | pci_set_power_state(pci, PCI_D3hot); | ||
1930 | return 0; | 1925 | return 0; |
1931 | } | 1926 | } |
1932 | 1927 | ||
1933 | static int snd_ca0106_resume(struct device *dev) | 1928 | static int snd_ca0106_resume(struct device *dev) |
1934 | { | 1929 | { |
1935 | struct pci_dev *pci = to_pci_dev(dev); | ||
1936 | struct snd_card *card = dev_get_drvdata(dev); | 1930 | struct snd_card *card = dev_get_drvdata(dev); |
1937 | struct snd_ca0106 *chip = card->private_data; | 1931 | struct snd_ca0106 *chip = card->private_data; |
1938 | int i; | 1932 | int i; |
1939 | 1933 | ||
1940 | pci_set_power_state(pci, PCI_D0); | ||
1941 | pci_restore_state(pci); | ||
1942 | |||
1943 | if (pci_enable_device(pci) < 0) { | ||
1944 | snd_card_disconnect(card); | ||
1945 | return -EIO; | ||
1946 | } | ||
1947 | |||
1948 | pci_set_master(pci); | ||
1949 | |||
1950 | ca0106_init_chip(chip, 1); | 1934 | ca0106_init_chip(chip, 1); |
1951 | 1935 | ||
1952 | if (chip->details->ac97) | 1936 | if (chip->details->ac97) |