projects
/
GitHub
/
LineageOS
/
G12
/
android_kernel_amlogic_linux-4.9.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
14c65f9
)
[ALSA] hda-codec - Don't create vmaster if no slaves found
author
Takashi Iwai
<tiwai@suse.de>
Fri, 22 Feb 2008 17:43:50 +0000
(18:43 +0100)
committer
Linus Torvalds
<torvalds@woody.linux-foundation.org>
Fri, 22 Feb 2008 22:20:09 +0000
(14:20 -0800)
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>
sound/pci/hda/hda_codec.c
patch
|
blob
|
blame
|
history
diff --git
a/sound/pci/hda/hda_codec.c
b/sound/pci/hda/hda_codec.c
index 5c6419ead015eb83b511599e534f87d8ef94f91c..37c413923db8a4762da4e7af66989af1e5e3d1a4 100644
(file)
--- 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,
const char **s;
int err;
+ for (s = slaves; *s && !snd_hda_find_mixer_ctl(codec, *s); s++)
+ ;
+ if (!*s) {
+ snd_printdd("No slave found for %s\n", name);
+ return 0;
+ }
kctl = snd_ctl_make_virtual_master(name, tlv);
if (!kctl)
return -ENOMEM;