All of lore.kernel.org
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: alsa-devel@alsa-project.org
Subject: [PATCH 12/33] ALSA: ctxfi: Simplify PM callbacks
Date: Fri,  9 Jan 2015 16:52:55 +0100	[thread overview]
Message-ID: <1420818796-30852-13-git-send-email-tiwai@suse.de> (raw)
In-Reply-To: <1420818796-30852-1-git-send-email-tiwai@suse.de>

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 |  9 ---------
 sound/pci/ctxfi/cthw20k2.c | 12 ------------
 2 files changed, 21 deletions(-)

diff --git a/sound/pci/ctxfi/cthw20k1.c b/sound/pci/ctxfi/cthw20k1.c
index b425aa8ee578..f16bec129c0a 100644
--- a/sound/pci/ctxfi/cthw20k1.c
+++ b/sound/pci/ctxfi/cthw20k1.c
@@ -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);
 }
diff --git a/sound/pci/ctxfi/cthw20k2.c b/sound/pci/ctxfi/cthw20k2.c
index 253899d13790..613671d330b1 100644
--- a/sound/pci/ctxfi/cthw20k2.c
+++ b/sound/pci/ctxfi/cthw20k2.c
@@ -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);
 }
-- 
2.2.1

  parent reply	other threads:[~2015-01-09 15:53 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-09 15:52 [PATCH 00/33] Simplify PM callbacks of PCI drivers Takashi Iwai
2015-01-09 15:52 ` [PATCH 01/33] ALSA: ali5451: Simplify PM callbacks Takashi Iwai
2015-01-09 15:52 ` [PATCH 02/33] ALSA: als300: " Takashi Iwai
2015-01-09 15:52 ` [PATCH 03/33] ALSA: als4000: " Takashi Iwai
2015-01-09 15:52 ` [PATCH 04/33] ALSA: atiixp: " Takashi Iwai
2015-01-09 15:52 ` [PATCH 05/33] ALSA: atiixp-modem: " Takashi Iwai
2015-01-09 15:52 ` [PATCH 06/33] ALSA: azt3328: " Takashi Iwai
2015-01-09 15:52 ` [PATCH 07/33] ALSA: ca0106: " Takashi Iwai
2015-01-09 15:52 ` [PATCH 08/33] ALSA: cmipci: " Takashi Iwai
2015-01-09 15:52 ` [PATCH 09/33] ALSA: cs4281: " Takashi Iwai
2015-01-09 15:52 ` [PATCH 10/33] ALSA: cs46xx: " Takashi Iwai
2015-01-09 15:52 ` [PATCH 11/33] ALSA: cs5535audio: " Takashi Iwai
2015-01-09 15:52 ` Takashi Iwai [this message]
2015-01-09 15:52 ` [PATCH 13/33] ALSA: echoaudio: " Takashi Iwai
2015-01-09 15:52 ` [PATCH 14/33] ALSA: emu10k1: " Takashi Iwai
2015-01-09 15:52 ` [PATCH 15/33] ALSA: ens137x: " Takashi Iwai
2015-01-09 15:52 ` [PATCH 16/33] ALSA: es1938: " Takashi Iwai
2015-01-09 15:53 ` [PATCH 17/33] ALSA: es1968: " Takashi Iwai
2015-01-09 15:53 ` [PATCH 18/33] ALSA: hda: " Takashi Iwai
2015-01-09 15:53 ` [PATCH 19/33] ALSA: ice1712: " Takashi Iwai
2015-01-09 15:53 ` [PATCH 20/33] ALSA: ice1724: " Takashi Iwai
2015-01-09 15:53 ` [PATCH 21/33] ALSA: intel8x0: " Takashi Iwai
2015-01-09 15:53 ` [PATCH 22/33] ALSA: intel8x0m: " Takashi Iwai
2015-01-09 15:53 ` [PATCH 23/33] ALSA: maestro3: " Takashi Iwai
2015-01-09 15:53 ` [PATCH 24/33] ALSA: nm256: " Takashi Iwai
2015-01-09 15:53 ` [PATCH 25/33] ALSA: oxygen: " Takashi Iwai
2015-01-09 16:24   ` Clemens Ladisch
2015-01-09 15:53 ` [PATCH 26/33] ALSA: riptide: " Takashi Iwai
2015-01-09 15:53 ` [PATCH 27/33] ALSA: rme96: " Takashi Iwai
2015-01-09 15:53 ` [PATCH 28/33] ALSA: sis7019: " Takashi Iwai
2015-01-09 15:53 ` [PATCH 29/33] ALSA: trident: " Takashi Iwai
2015-01-09 15:53 ` [PATCH 30/33] ALSA: via82xx: " Takashi Iwai
2015-01-09 15:53 ` [PATCH 31/33] ALSA: via82xx-modem: " Takashi Iwai
2015-01-09 15:53 ` [PATCH 32/33] ALSA: vx222: " Takashi Iwai
2015-01-09 15:53 ` [PATCH 33/33] ALSA: ymfpci: " Takashi Iwai

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1420818796-30852-13-git-send-email-tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=alsa-devel@alsa-project.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.