Commit 1caf64d9 authored by Takashi Iwai's avatar Takashi Iwai

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.deSigned-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent ae07eb9b
...@@ -3440,7 +3440,6 @@ static int snd_ac97_add_vmaster(struct snd_ac97 *ac97, char *name, ...@@ -3440,7 +3440,6 @@ static int snd_ac97_add_vmaster(struct snd_ac97 *ac97, char *name,
const char * const *followers) const char * const *followers)
{ {
struct snd_kcontrol *kctl; struct snd_kcontrol *kctl;
const char * const *s;
int err; int err;
kctl = snd_ctl_make_virtual_master(name, tlv); kctl = snd_ctl_make_virtual_master(name, tlv);
...@@ -3450,20 +3449,7 @@ static int snd_ac97_add_vmaster(struct snd_ac97 *ac97, char *name, ...@@ -3450,20 +3449,7 @@ static int snd_ac97_add_vmaster(struct snd_ac97 *ac97, char *name,
if (err < 0) if (err < 0)
return err; return err;
for (s = followers; *s; s++) { return snd_ctl_add_followers(ac97->bus->card, kctl, followers);
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;
} }
static int patch_vt1616_specific(struct snd_ac97 * ac97) static int patch_vt1616_specific(struct snd_ac97 * ac97)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment