提交 58ce2fb8 编写于 作者: T Takashi Iwai 提交者: Jialin Zhang

ALSA: usb-audio: Register card again for iface over delayed_register option

stable inclusion
from stable-v5.10.143
commit 6ccbb74801bbcba94697743adbc917352aef2a9d
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I6D0U6

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=6ccbb74801bbcba94697743adbc917352aef2a9d

--------------------------------

[ Upstream commit 2027f114 ]

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: b70038ef ("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.deSigned-off-by: NTakashi Iwai <tiwai@suse.de>
Signed-off-by: NSasha Levin <sashal@kernel.org>
Signed-off-by: NJialin Zhang <zhangjialin11@huawei.com>
Reviewed-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 a55fc44f
...@@ -667,7 +667,7 @@ static bool check_delayed_register_option(struct snd_usb_audio *chip, int iface) ...@@ -667,7 +667,7 @@ static bool check_delayed_register_option(struct snd_usb_audio *chip, int iface)
if (delayed_register[i] && if (delayed_register[i] &&
sscanf(delayed_register[i], "%x:%x", &id, &inum) == 2 && sscanf(delayed_register[i], "%x:%x", &id, &inum) == 2 &&
id == chip->usb_id) id == chip->usb_id)
return inum != iface; return iface < inum;
} }
return false; return false;
......
...@@ -1911,7 +1911,7 @@ bool snd_usb_registration_quirk(struct snd_usb_audio *chip, int iface) ...@@ -1911,7 +1911,7 @@ bool snd_usb_registration_quirk(struct snd_usb_audio *chip, int iface)
for (q = registration_quirks; q->usb_id; q++) for (q = registration_quirks; q->usb_id; q++)
if (chip->usb_id == q->usb_id) if (chip->usb_id == q->usb_id)
return iface != q->interface; return iface < q->interface;
/* Register as normal */ /* Register as normal */
return false; return false;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册