From: Takashi Iwai <tiwai@suse.de>
To: alsa-devel@alsa-project.org
Cc: Andrey Grodzovsky <andrey.grodzovsky@amd.com>
Subject: [PATCH 3/7] ALSA: control: Drop superfluous snd_power_wait() calls
Date: Tue, 18 May 2021 18:51:57 +0200 [thread overview]
Message-ID: <20210518165201.24376-4-tiwai@suse.de> (raw)
In-Reply-To: <20210518165201.24376-1-tiwai@suse.de>
Now the card power state is checked in the common ioctl handler, drop
the same redundant checks in each ioctl.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
sound/core/control.c | 11 -----------
sound/core/control_compat.c | 9 ---------
2 files changed, 20 deletions(-)
diff --git a/sound/core/control.c b/sound/core/control.c
index c22c3fad0c64..799d91ddccb0 100644
--- a/sound/core/control.c
+++ b/sound/core/control.c
@@ -1042,9 +1042,6 @@ static int snd_ctl_elem_info_user(struct snd_ctl_file *ctl,
if (copy_from_user(&info, _info, sizeof(info)))
return -EFAULT;
- result = snd_power_wait(ctl->card, SNDRV_CTL_POWER_D0);
- if (result < 0)
- return result;
result = snd_ctl_elem_info(ctl, &info);
if (result < 0)
return result;
@@ -1113,10 +1110,6 @@ static int snd_ctl_elem_read_user(struct snd_card *card,
if (IS_ERR(control))
return PTR_ERR(control);
- result = snd_power_wait(card, SNDRV_CTL_POWER_D0);
- if (result < 0)
- goto error;
-
down_read(&card->controls_rwsem);
result = snd_ctl_elem_read(card, control);
up_read(&card->controls_rwsem);
@@ -1183,10 +1176,6 @@ static int snd_ctl_elem_write_user(struct snd_ctl_file *file,
return PTR_ERR(control);
card = file->card;
- result = snd_power_wait(card, SNDRV_CTL_POWER_D0);
- if (result < 0)
- goto error;
-
result = snd_ctl_elem_write(card, file, control);
if (result < 0)
goto error;
diff --git a/sound/core/control_compat.c b/sound/core/control_compat.c
index d5b562ff237b..57b73ab57506 100644
--- a/sound/core/control_compat.c
+++ b/sound/core/control_compat.c
@@ -96,9 +96,6 @@ static int snd_ctl_elem_info_compat(struct snd_ctl_file *ctl,
if (get_user(data->value.enumerated.item, &data32->value.enumerated.item))
goto error;
- err = snd_power_wait(ctl->card, SNDRV_CTL_POWER_D0);
- if (err < 0)
- goto error;
err = snd_ctl_elem_info(ctl, data);
if (err < 0)
goto error;
@@ -298,9 +295,6 @@ static int ctl_elem_read_user(struct snd_card *card,
if (err < 0)
goto error;
- err = snd_power_wait(card, SNDRV_CTL_POWER_D0);
- if (err < 0)
- goto error;
err = snd_ctl_elem_read(card, data);
if (err < 0)
goto error;
@@ -326,9 +320,6 @@ static int ctl_elem_write_user(struct snd_ctl_file *file,
if (err < 0)
goto error;
- err = snd_power_wait(card, SNDRV_CTL_POWER_D0);
- if (err < 0)
- goto error;
err = snd_ctl_elem_write(card, file, data);
if (err < 0)
goto error;
--
2.26.2
next prev parent reply other threads:[~2021-05-18 16:55 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-18 16:51 [PATCH 0/7] ALSA: Prep work for PCI rescan support Takashi Iwai
2021-05-18 16:51 ` [PATCH 1/7] ALSA: core: Use READ_ONCE() / WRITE_ONCE() for power state change Takashi Iwai
2021-05-18 16:51 ` [PATCH 2/7] ALSA: control: Add power state check commonly for ioctl handlers Takashi Iwai
2021-05-18 18:00 ` Jaroslav Kysela
2021-05-18 19:31 ` Takashi Iwai
2021-05-18 16:51 ` Takashi Iwai [this message]
2021-05-18 16:51 ` [PATCH 4/7] ALSA: control: Minor optimization for SNDRV_CTL_IOCTL_POWER_STATE Takashi Iwai
2021-05-18 16:51 ` [PATCH 5/7] ALSA: control: Track in-flight control read/write/tlv accesses Takashi Iwai
2021-05-18 18:01 ` Jaroslav Kysela
2021-05-18 18:54 ` Takashi Iwai
2021-05-18 16:52 ` [PATCH 6/7] ALSA: pcm: Block the release until the system resume finishes Takashi Iwai
2021-05-18 16:52 ` [PATCH 7/7] ALSA: Drop superfluous argument from snd_power_wait() 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=20210518165201.24376-4-tiwai@suse.de \
--to=tiwai@suse.de \
--cc=alsa-devel@alsa-project.org \
--cc=andrey.grodzovsky@amd.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox