From: Takashi Iwai <tiwai@suse.de>
To: alsa-devel@alsa-project.org
Cc: Takashi Iwai <tiwai@suse.de>
Subject: [PATCH 2/4] ALSA: ac97: Use the standard snd_ctl_add_followers() helper
Date: Thu, 20 Jul 2023 10:25:52 +0200 [thread overview]
Message-ID: <20230720082554.31891-3-tiwai@suse.de> (raw)
In-Reply-To: <20230720082554.31891-1-tiwai@suse.de>
Instead of open-code, use the new standard helper to manage vmaster
stuff for code simplification.
Except for a debug print, there should be no functional change.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
sound/pci/ac97/ac97_patch.c | 16 +++-------------
1 file changed, 3 insertions(+), 13 deletions(-)
diff --git a/sound/pci/ac97/ac97_patch.c b/sound/pci/ac97/ac97_patch.c
index ccfd9c7bf900..09626aed967d 100644
--- a/sound/pci/ac97/ac97_patch.c
+++ b/sound/pci/ac97/ac97_patch.c
@@ -3440,7 +3440,6 @@ static int snd_ac97_add_vmaster(struct snd_ac97 *ac97, char *name,
const char * const *followers)
{
struct snd_kcontrol *kctl;
- const char * const *s;
int err;
kctl = snd_ctl_make_virtual_master(name, tlv);
@@ -3450,19 +3449,10 @@ static int snd_ac97_add_vmaster(struct snd_ac97 *ac97, char *name,
if (err < 0)
return err;
- for (s = followers; *s; s++) {
- struct snd_kcontrol *sctl;
+ err = snd_ctl_add_followers(ac97->bus->card, kctl, followers);
+ if (err < 0)
+ return err;
- sctl = snd_ac97_find_mixer_ctl(ac97, *s);
- if (!sctl) {
- dev_dbg(ac97->bus->card->dev,
- "Cannot find follower %s, skipped\n", *s);
- continue;
- }
- err = snd_ctl_add_follower(kctl, sctl);
- if (err < 0)
- return err;
- }
return 0;
}
--
2.35.3
next prev parent reply other threads:[~2023-07-20 8:27 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-20 8:25 [PATCH 0/4] ALSA: Cleanup with snd_ctl_add_followers() Takashi Iwai
2023-07-20 8:25 ` [PATCH 1/4] ALSA: vmaster: Add snd_ctl_add_followers() helper Takashi Iwai
2023-07-20 8:25 ` Takashi Iwai [this message]
2023-07-20 10:35 ` [PATCH 2/4] ALSA: ac97: Use the standard " Oswald Buddenhagen
2023-07-20 10:59 ` Takashi Iwai
2023-07-20 8:25 ` [PATCH 3/4] ALSA: ca0106: " Takashi Iwai
2023-07-20 8:25 ` [PATCH 4/4] ALSA: ice1712: " 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=20230720082554.31891-3-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.