]> git.baikalelectronics.ru Git - kernel.git/commit
ALSA: usb-audio: Fix last interface check for registration
authorTakashi Iwai <tiwai@suse.de>
Thu, 15 Sep 2022 08:59:47 +0000 (10:59 +0200)
committerTakashi Iwai <tiwai@suse.de>
Thu, 15 Sep 2022 09:00:21 +0000 (11:00 +0200)
commit265e20d2788f6c10644cd1a36a40d72067660f62
treec7056718ac7b7c58cdee2467d0203270620f74c1
parenta2f26bf8495c1ea27c3948168be9033a225ec557
ALSA: usb-audio: Fix last interface check for registration

The recent fix in commit 48b4b038c735 ("ALSA: usb-audio: Register card
at the last interface") tried to delay the card registration until the
last found interface is probed.  It assumed that the probe callback
gets called for those later interfaces, but it's not always true; as
the driver loops over the descriptor and probes the matching ones,
it's not separately called via multiple probe calls.  This results in
the missing card registration, i.e. no sound device.

For addressing this problem, replace the check whether the last
interface is processed with usb_interface_claimed() instead of the
comparison with the probe interface number.

Fixes: 48b4b038c735 ("ALSA: usb-audio: Register card at the last interface")
Link: https://lore.kernel.org/r/20220915085947.7922-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/usb/card.c