]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit3366aced2900dc5191c05ab36ccbabb8f9c79b81
treee483a8a67d15d74c53fe82486da839b46156974b
parent10e8d2bedf985197d3411df31262fd84e7872272
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