aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2015-01-08 06:45:12 -0500
committerTakashi Iwai <tiwai@suse.de>2015-01-09 10:24:19 -0500
commit5762fdb5f9b18a5bf8cdbdfbc0c735ad1d88a478 (patch)
treeb1594f1499bfd62778e9848fe5062ae8f6d87bd6
parent11afa6426c4ff69cc58f0b91e85cf17f31c0a442 (diff)
ALSA: cmipci: 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/cmipci.c15
1 files changed, 0 insertions, 15 deletions
diff --git a/sound/pci/cmipci.c b/sound/pci/cmipci.c
index 85ed40339db9..63d2c8236ec6 100644
--- a/sound/pci/cmipci.c
+++ b/sound/pci/cmipci.c
@@ -3347,7 +3347,6 @@ static unsigned char saved_mixers[] = {
3347 3347
3348static int snd_cmipci_suspend(struct device *dev) 3348static int snd_cmipci_suspend(struct device *dev)
3349{ 3349{
3350 struct pci_dev *pci = to_pci_dev(dev);
3351 struct snd_card *card = dev_get_drvdata(dev); 3350 struct snd_card *card = dev_get_drvdata(dev);
3352 struct cmipci *cm = card->private_data; 3351 struct cmipci *cm = card->private_data;
3353 int i; 3352 int i;
@@ -3366,29 +3365,15 @@ static int snd_cmipci_suspend(struct device *dev)
3366 3365
3367 /* disable ints */ 3366 /* disable ints */
3368 snd_cmipci_write(cm, CM_REG_INT_HLDCLR, 0); 3367 snd_cmipci_write(cm, CM_REG_INT_HLDCLR, 0);
3369
3370 pci_disable_device(pci);
3371 pci_save_state(pci);
3372 pci_set_power_state(pci, PCI_D3hot);
3373 return 0; 3368 return 0;
3374} 3369}
3375 3370
3376static int snd_cmipci_resume(struct device *dev) 3371static int snd_cmipci_resume(struct device *dev)
3377{ 3372{
3378 struct pci_dev *pci = to_pci_dev(dev);
3379 struct snd_card *card = dev_get_drvdata(dev); 3373 struct snd_card *card = dev_get_drvdata(dev);
3380 struct cmipci *cm = card->private_data; 3374 struct cmipci *cm = card->private_data;
3381 int i; 3375 int i;
3382 3376
3383 pci_set_power_state(pci, PCI_D0);
3384 pci_restore_state(pci);
3385 if (pci_enable_device(pci) < 0) {
3386 dev_err(dev, "pci_enable_device failed, disabling device\n");
3387 snd_card_disconnect(card);
3388 return -EIO;
3389 }
3390 pci_set_master(pci);
3391
3392 /* reset / initialize to a sane state */ 3377 /* reset / initialize to a sane state */
3393 snd_cmipci_write(cm, CM_REG_INT_HLDCLR, 0); 3378 snd_cmipci_write(cm, CM_REG_INT_HLDCLR, 0);
3394 snd_cmipci_ch_reset(cm, CM_CH_PLAY); 3379 snd_cmipci_ch_reset(cm, CM_CH_PLAY);