Commit 7751e0e8 authored by Clemens Ladisch's avatar Clemens Ladisch Committed by Ben Hutchings

ALSA: usb-audio: fix missing input volume controls in MAYA44 USB(+)

commit ea114fc2 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: default avatarnightmixes <nightmixes@gmail.com>
Tested-by: default avatarnightmixes <nightmixes@gmail.com>
Signed-off-by: default avatarClemens Ladisch <clemens@ladisch.de>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
[bwh: Backported to 3.2:
 - Adjust context
 - Logging statement was different]
Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
parent a2066716
...@@ -1425,11 +1425,6 @@ static int parse_audio_mixer_unit(struct mixer_build *state, int unitid, void *r ...@@ -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); snd_printk(KERN_ERR "invalid MIXER UNIT descriptor %d\n", unitid);
return -EINVAL; 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; num_ins = 0;
ich = 0; ich = 0;
...@@ -1437,6 +1432,9 @@ static int parse_audio_mixer_unit(struct mixer_build *state, int unitid, void *r ...@@ -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]); err = parse_audio_unit(state, desc->baSourceID[pin]);
if (err < 0) if (err < 0)
return err; 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); err = check_input_term(state, desc->baSourceID[pin], &iterm);
if (err < 0) if (err < 0)
return err; return err;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment