summaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2009-03-06 10:08:14 +0100
committerTakashi Iwai <tiwai@suse.de>2009-03-06 10:08:14 +0100
commit7a411ee01bf3114ba2a2ae013eaae4e3c41f8eb5 (patch)
tree3362c9c8e2c9c34f9315619408283f703c376d36 /sound
parentdc04d1b4d2043e2fca2d94d6d5542b930f2bc5b3 (diff)
downloadlinux-3.10-7a411ee01bf3114ba2a2ae013eaae4e3c41f8eb5.tar.gz
linux-3.10-7a411ee01bf3114ba2a2ae013eaae4e3c41f8eb5.tar.bz2
linux-3.10-7a411ee01bf3114ba2a2ae013eaae4e3c41f8eb5.zip
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>
Diffstat (limited to 'sound')
-rw-r--r--sound/pci/hda/hda_codec.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c
index 04cb1251e3e..1885e764910 100644
--- a/sound/pci/hda/hda_codec.c
+++ b/sound/pci/hda/hda_codec.c
@@ -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;
}