Commit 7a411ee0 authored by Takashi Iwai's avatar Takashi Iwai

ALSA: hda - Allow slave controls with non-zero indices

Fix snd_hda_add_vmaster() to check the non-zero indices of slave controls.
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent dc04d1b4
...@@ -1552,15 +1552,20 @@ int snd_hda_add_vmaster(struct hda_codec *codec, char *name, ...@@ -1552,15 +1552,20 @@ int snd_hda_add_vmaster(struct hda_codec *codec, char *name,
for (s = slaves; *s; s++) { for (s = slaves; *s; s++) {
struct snd_kcontrol *sctl; struct snd_kcontrol *sctl;
int i = 0;
sctl = snd_hda_find_mixer_ctl(codec, *s); for (;;) {
if (!sctl) { sctl = _snd_hda_find_mixer_ctl(codec, *s, i);
snd_printdd("Cannot find slave %s, skipped\n", *s); if (!sctl) {
continue; if (!i)
snd_printdd("Cannot find slave %s, "
"skipped\n", *s);
break;
}
err = snd_ctl_add_slave(kctl, sctl);
if (err < 0)
return err;
i++;
} }
err = snd_ctl_add_slave(kctl, sctl);
if (err < 0)
return err;
} }
return 0; return 0;
} }
......
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