summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClemens Ladisch <clemens@ladisch.de>2015-06-03 11:36:51 +0200
committerBen Hutchings <ben@decadent.org.uk>2015-08-07 00:32:14 +0100
commit7751e0e89bce8d805869116724ad1acb0b2e6f29 (patch)
tree67bc950a6632e1383f92a252f07793a563575d1d
parenta2066716effdbaa16500427710c59db7e540fd5a (diff)
ALSA: usb-audio: fix missing input volume controls in MAYA44 USB(+)
commit ea114fc27dc0cb9a550b6add5426720feb66262a upstream. The driver worked around an error in the MAYA44 USB(+)'s mixer unit descriptor by aborting before parsing the missing field. However, aborting parsing too early prevented parsing of the other units connected to this unit, so the capture mixer controls would be missing. Fix this by moving the check for this descriptor error after the parsing of the unit's input pins. Reported-by: nightmixes <nightmixes@gmail.com> Tested-by: nightmixes <nightmixes@gmail.com> Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Takashi Iwai <tiwai@suse.de> [bwh: Backported to 3.2: - Adjust context - Logging statement was different] Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
-rw-r--r--sound/usb/mixer.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/sound/usb/mixer.c b/sound/usb/mixer.c
index c6457c5d2d2a..488e5318f342 100644
--- a/sound/usb/mixer.c
+++ b/sound/usb/mixer.c
@@ -1425,11 +1425,6 @@ static int parse_audio_mixer_unit(struct mixer_build *state, int unitid, void *r
snd_printk(KERN_ERR "invalid MIXER UNIT descriptor %d\n", unitid);
return -EINVAL;
}
- /* no bmControls field (e.g. Maya44) -> ignore */
- if (desc->bLength <= 10 + input_pins) {
- snd_printdd(KERN_INFO "MU %d has no bmControls field\n", unitid);
- return 0;
- }
num_ins = 0;
ich = 0;
@@ -1437,6 +1432,9 @@ static int parse_audio_mixer_unit(struct mixer_build *state, int unitid, void *r
err = parse_audio_unit(state, desc->baSourceID[pin]);
if (err < 0)
return err;
+ /* no bmControls field (e.g. Maya44) -> ignore */
+ if (desc->bLength <= 10 + input_pins)
+ continue;
err = check_input_term(state, desc->baSourceID[pin], &iterm);
if (err < 0)
return err;