diff options
author | Takashi Iwai <tiwai@suse.de> | 2023-07-21 10:16:41 +0300 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2023-07-21 10:37:48 +0300 |
commit | 1caf64d91f72321191f7dc24d8e950222acc9bfa (patch) | |
tree | e9e75e0940f46c0481eedaf4ab37541725e977f5 /sound/pci/ac97 | |
parent | ae07eb9bf23e1a52cdb28222a71eb014131018d8 (diff) | |
download | linux-1caf64d91f72321191f7dc24d8e950222acc9bfa.tar.xz |
ALSA: ac97: Use the standard snd_ctl_add_followers() helper
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.
Link: https://lore.kernel.org/r/20230721071643.3631-3-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/ac97')
-rw-r--r-- | sound/pci/ac97/ac97_patch.c | 16 |
1 files changed, 1 insertions, 15 deletions
diff --git a/sound/pci/ac97/ac97_patch.c b/sound/pci/ac97/ac97_patch.c index ccfd9c7bf900..1d786bd5ce3e 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,20 +3449,7 @@ 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; - - 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; + return snd_ctl_add_followers(ac97->bus->card, kctl, followers); } static int patch_vt1616_specific(struct snd_ac97 * ac97) |