ALSA: usb-audio: Clean up check_input_term()
authorTakashi Iwai <tiwai@suse.de>
Fri, 23 Aug 2019 10:38:07 +0000 (12:38 +0200)
committerTakashi Iwai <tiwai@suse.de>
Sun, 25 Aug 2019 08:12:52 +0000 (10:12 +0200)
commite0ccdef92653f8867e2d1667facfd3c23699f540
treee483a8a67d15d74c53fe82486da839b46156974b
parent744f51e863462192727f9118642563d46fa81393
ALSA: usb-audio: Clean up check_input_term()

The primary changes in this patch are cleanups of __check_input_term()
and move to a non-nested switch-case block by evaluating the pair of
UAC version and the unit type, as we've done for parse_audio_unit().
Also each parser is split into the function for readability.

Now, a slight behavior change by this cleanup is the handling of
processing and extension units.  Formerly we've dealt with them
differently between UAC1/2 and UAC3; the latter returns an error if no
input sources are available, while the former continues to parse.

In this patch, unify the behavior in all cases: when input sources are
available, it parses recursively, then override the type and the id,
as well as channel information if not provided yet.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/usb/mixer.c