summaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2022-09-15 10:59:47 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-10-26 12:35:54 +0200
commit28787ff9fbeaf57684eb64cc33e2ec8ceedf21b5 (patch)
tree69471adcd7619bca8ed85aae16895fc80725867f /sound
parentb8989e95d74ebf1d0e9c32d1ffe2a5590a76b0a1 (diff)
ALSA: usb-audio: Fix last interface check for registration
commit 39efc9c8a973ddff5918191525d1679d0fb368ea upstream. The recent fix in commit 6392dcd1d0c7 ("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: 6392dcd1d0c7 ("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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'sound')
-rw-r--r--sound/usb/card.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sound/usb/card.c b/sound/usb/card.c
index 207c212eabde..4526f1d1fd6e 100644
--- a/sound/usb/card.c
+++ b/sound/usb/card.c
@@ -883,7 +883,7 @@ static int usb_audio_probe(struct usb_interface *intf,
* one given via option
*/
if (check_delayed_register_option(chip) == ifnum ||
- chip->last_iface == ifnum) {
+ usb_interface_claimed(usb_ifnum_to_if(dev, chip->last_iface))) {
err = snd_card_register(chip->card);
if (err < 0)
goto __error;