Skip to content

Commit

Permalink
ALSA: hda - Allow slave controls with non-zero indices
Browse files Browse the repository at this point in the history
Fix snd_hda_add_vmaster() to check the non-zero indices of slave controls.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
  • Loading branch information
Takashi Iwai committed Mar 6, 2009
1 parent dc04d1b commit 7a411ee
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions sound/pci/hda/hda_codec.c
Original file line number Diff line number Diff line change
Expand Up @@ -1552,15 +1552,20 @@ int snd_hda_add_vmaster(struct hda_codec *codec, char *name,

for (s = slaves; *s; s++) {
struct snd_kcontrol *sctl;

sctl = snd_hda_find_mixer_ctl(codec, *s);
if (!sctl) {
snd_printdd("Cannot find slave %s, skipped\n", *s);
continue;
int i = 0;
for (;;) {
sctl = _snd_hda_find_mixer_ctl(codec, *s, i);
if (!sctl) {
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;
}
Expand Down

0 comments on commit 7a411ee

Please sign in to comment.