All of lore.kernel.org
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: alsa-devel@alsa-project.org
Cc: Takashi Iwai <tiwai@suse.de>
Subject: [PATCH v2 4/6] ALSA: control: Minor optimization for SNDRV_CTL_IOCTL_POWER_STATE
Date: Sun, 23 May 2021 11:09:18 +0200	[thread overview]
Message-ID: <20210523090920.15345-5-tiwai@suse.de> (raw)
In-Reply-To: <20210523090920.15345-1-tiwai@suse.de>

Long long time ago, before the proper PM framework was introduced, it
was still possible to reach SNDRV_CTL_IOCTL_POWER ioctl during the
power off state.  This ioctl existed as a main control for the suspend
resume state in the past, but the feature was already dropped along
with the standard PM framework.  Now the read part,
SNDRV_IOCTL_POWER_STATE ioctl, returns practically always D0, and we
can do some minor optimization there.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
 sound/core/control.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/sound/core/control.c b/sound/core/control.c
index 7fe901384c9c..a25c0d64d104 100644
--- a/sound/core/control.c
+++ b/sound/core/control.c
@@ -1817,11 +1817,7 @@ static long snd_ctl_ioctl(struct file *file, unsigned int cmd, unsigned long arg
 	case SNDRV_CTL_IOCTL_POWER:
 		return -ENOPROTOOPT;
 	case SNDRV_CTL_IOCTL_POWER_STATE:
-#ifdef CONFIG_PM
-		return put_user(card->power_state, ip) ? -EFAULT : 0;
-#else
 		return put_user(SNDRV_CTL_POWER_D0, ip) ? -EFAULT : 0;
-#endif
 	}
 	down_read(&snd_ioctl_rwsem);
 	list_for_each_entry(p, &snd_control_ioctls, list) {
-- 
2.26.2


  parent reply	other threads:[~2021-05-23  9:11 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-23  9:09 [PATCH v2 0/6] ALSA: Prep work for PCI rescan support Takashi Iwai
2021-05-23  9:09 ` [PATCH v2 1/6] ALSA: core: Use READ_ONCE() / WRITE_ONCE() for power state change Takashi Iwai
2021-05-23  9:09 ` [PATCH v2 2/6] ALSA: control: Track in-flight control read/write/tlv accesses Takashi Iwai
2021-05-23  9:09 ` [PATCH v2 3/6] ALSA: control: Drop superfluous snd_power_wait() calls Takashi Iwai
2021-05-23  9:09 ` Takashi Iwai [this message]
2021-05-23  9:09 ` [PATCH v2 5/6] ALSA: Drop superfluous argument from snd_power_wait() Takashi Iwai
2021-05-24  8:39   ` Mark Brown
2021-05-23  9:09 ` [PATCH v2 6/6] ALSA: pcm: Block the release until the system resume finishes Takashi Iwai
2021-05-24  9:32 ` [PATCH v2 0/6] ALSA: Prep work for PCI rescan support Jaroslav Kysela
2021-05-25  6:56 ` 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=20210523090920.15345-5-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.