Skip to content

Commit

Permalink
ALSA: usb-audio: Register card again for iface over delayed_register …
Browse files Browse the repository at this point in the history
…option

[ Upstream commit 2027f11 ]

When the delayed registration is specified via either delayed_register
option or the quirk, we delay the invocation of snd_card_register()
until the given interface.  But if a wrong value has been set there
and there are more interfaces over the given interface number,
snd_card_register() call would be missing for those interfaces.

This patch catches up those missing calls by fixing the comparison of
the interface number.  Now the call is skipped only if the processed
interface is less than the given interface, instead of the exact
match.

Fixes: b70038e ("ALSA: usb-audio: Add delayed_register option")
Link: https://bugzilla.kernel.org/show_bug.cgi?id=216082
Link: https://lore.kernel.org/r/20220831125901.4660-2-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
tiwai authored and gregkh committed Sep 15, 2022
1 parent 4dc401e commit 59f1c62
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion sound/usb/card.c
Expand Up @@ -698,7 +698,7 @@ static bool check_delayed_register_option(struct snd_usb_audio *chip, int iface)
if (delayed_register[i] &&
sscanf(delayed_register[i], "%x:%x", &id, &inum) == 2 &&
id == chip->usb_id)
return inum != iface;
return iface < inum;
}

return false;
Expand Down
2 changes: 1 addition & 1 deletion sound/usb/quirks.c
Expand Up @@ -1764,7 +1764,7 @@ bool snd_usb_registration_quirk(struct snd_usb_audio *chip, int iface)

for (q = registration_quirks; q->usb_id; q++)
if (chip->usb_id == q->usb_id)
return iface != q->interface;
return iface < q->interface;

/* Register as normal */
return false;
Expand Down

0 comments on commit 59f1c62

Please sign in to comment.