All of lore.kernel.org
 help / color / mirror / Atom feed
From: Clemens Ladisch <clemens@ladisch.de>
To: Takashi Iwai <tiwai@suse.de>, alsa-devel@alsa-project.org
Subject: Re: [PATCH 25/33] ALSA: oxygen: Simplify PM callbacks
Date: Fri, 09 Jan 2015 17:24:28 +0100	[thread overview]
Message-ID: <54B000BC.3010802@ladisch.de> (raw)
In-Reply-To: <1420818796-30852-26-git-send-email-tiwai@suse.de>

Takashi Iwai wrote:
> 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>

Acked-by: Clemens Ladisch <clemens@ladisch.de>

> ---
>  sound/pci/oxygen/oxygen_lib.c | 15 ---------------
>  1 file changed, 15 deletions(-)
>
> diff --git a/sound/pci/oxygen/oxygen_lib.c b/sound/pci/oxygen/oxygen_lib.c
> index b67e30602473..366723cf6d7a 100644
> --- a/sound/pci/oxygen/oxygen_lib.c
> +++ b/sound/pci/oxygen/oxygen_lib.c
> @@ -728,7 +728,6 @@ EXPORT_SYMBOL(oxygen_pci_remove);
>  #ifdef CONFIG_PM_SLEEP
>  static int oxygen_pci_suspend(struct device *dev)
>  {
> -	struct pci_dev *pci = to_pci_dev(dev);
>  	struct snd_card *card = dev_get_drvdata(dev);
>  	struct oxygen *chip = card->private_data;
>  	unsigned int i, saved_interrupt_mask;
> @@ -753,10 +752,6 @@ static int oxygen_pci_suspend(struct device *dev)
>  	flush_work(&chip->spdif_input_bits_work);
>  	flush_work(&chip->gpio_work);
>  	chip->interrupt_mask = saved_interrupt_mask;
> -
> -	pci_disable_device(pci);
> -	pci_save_state(pci);
> -	pci_set_power_state(pci, PCI_D3hot);
>  	return 0;
>  }
>
> @@ -788,20 +783,10 @@ static void oxygen_restore_ac97(struct oxygen *chip, unsigned int codec)
>
>  static int oxygen_pci_resume(struct device *dev)
>  {
> -	struct pci_dev *pci = to_pci_dev(dev);
>  	struct snd_card *card = dev_get_drvdata(dev);
>  	struct oxygen *chip = card->private_data;
>  	unsigned int i;
>
> -	pci_set_power_state(pci, PCI_D0);
> -	pci_restore_state(pci);
> -	if (pci_enable_device(pci) < 0) {
> -		dev_err(dev, "cannot reenable device");
> -		snd_card_disconnect(card);
> -		return -EIO;
> -	}
> -	pci_set_master(pci);
> -
>  	oxygen_write16(chip, OXYGEN_DMA_STATUS, 0);
>  	oxygen_write16(chip, OXYGEN_INTERRUPT_MASK, 0);
>  	for (i = 0; i < OXYGEN_IO_SIZE; ++i)

  reply	other threads:[~2015-01-09 16:24 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 ` [PATCH 12/33] ALSA: ctxfi: " Takashi Iwai
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 [this message]
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=54B000BC.3010802@ladisch.de \
    --to=clemens@ladisch.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=tiwai@suse.de \
    /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.