mirror of
https://github.com/FEX-Emu/linux.git
synced 2025-01-05 17:01:17 +00:00
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: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
parent
dc04d1b4d2
commit
7a411ee01b
@ -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;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user