]> git.ipfire.org Git - thirdparty/linux.git/commit
ALSA: usb-audio: More relaxed check of MIDI jack names
authorTakashi Iwai <tiwai@suse.de>
Thu, 15 Feb 2024 15:31:44 +0000 (16:31 +0100)
committerTakashi Iwai <tiwai@suse.de>
Thu, 15 Feb 2024 15:56:05 +0000 (16:56 +0100)
commit41c25e193b2befc22462aa41591d397fab174ca1
treec336d80316f21180cc2cd1a43921941181b17b3a
parent32f03f4002c5df837fb920eb23fcd2f4af9b0b23
ALSA: usb-audio: More relaxed check of MIDI jack names

The USB audio driver tries to retrieve MIDI jack name strings that can
be used for rawmidi substream names and sequencer port names, but its
checking is too strict: often the firmware provides the jack info for
unexpected directions, and then we miss the info although it's
present.

In this patch, the code to extract the jack info is changed to allow
both in and out directions in a single loop.  That is, the former two
functions to obtain the descriptor pointers for jack in and out are
changed to a single function that returns iJack of the corresponding
jack ID, no matter which direction is used.  It's a code
simplification at the same time as well as the fix.

Fixes: eb596e0fd13c ("ALSA: usb-audio: generate midi streaming substream names from jack names")
Link: https://lore.kernel.org/r/20240215153144.26047-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/usb/midi.c