diff options
author | Takashi Iwai <tiwai@suse.de> | 2008-02-22 12:43:50 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2008-02-22 17:20:09 -0500 |
commit | 2f0855497738a56825ee6445574835b4fc1d77d5 (patch) | |
tree | 0c745f07383f08e3e4d03eb3dc1c59a3aa6d99bf /sound/pci | |
parent | 14c65f98bfea9324cf334793305dd262d0095850 (diff) |
[ALSA] hda-codec - Don't create vmaster if no slaves found
Don't create vmaster controls if no slaves are found in the given list.
This prevents the error due to an empty vmaster control.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'sound/pci')
-rw-r--r-- | sound/pci/hda/hda_codec.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c index 5c6419ead015..37c413923db8 100644 --- a/sound/pci/hda/hda_codec.c +++ b/sound/pci/hda/hda_codec.c | |||
@@ -1055,6 +1055,12 @@ int snd_hda_add_vmaster(struct hda_codec *codec, char *name, | |||
1055 | const char **s; | 1055 | const char **s; |
1056 | int err; | 1056 | int err; |
1057 | 1057 | ||
1058 | for (s = slaves; *s && !snd_hda_find_mixer_ctl(codec, *s); s++) | ||
1059 | ; | ||
1060 | if (!*s) { | ||
1061 | snd_printdd("No slave found for %s\n", name); | ||
1062 | return 0; | ||
1063 | } | ||
1058 | kctl = snd_ctl_make_virtual_master(name, tlv); | 1064 | kctl = snd_ctl_make_virtual_master(name, tlv); |
1059 | if (!kctl) | 1065 | if (!kctl) |
1060 | return -ENOMEM; | 1066 | return -ENOMEM; |