]> git.itanic.dy.fi Git - linux-stable/commit
ALSA: usb-audio: Inform the delayed registration more properly
authorTakashi Iwai <tiwai@suse.de>
Wed, 31 Aug 2022 12:59:00 +0000 (14:59 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 15 Sep 2022 09:32:05 +0000 (11:32 +0200)
commit1d29a63585b3344137ceeaf19f5a3bfd222f7c9e
treec34b8fab13ccc35d9a689462e9652f9b0e8a48fd
parente12ce30fe593dd438c5b392290ad7316befc11ca
ALSA: usb-audio: Inform the delayed registration more properly

[ Upstream commit 7e1afce5866e02b45bf88c27dd7de1b9dfade1cc ]

The info message that was added in the commit a4aad5636c72 ("ALSA:
usb-audio: Inform devices that need delayed registration") is actually
useful to know the need for the delayed registration.  However, it
turned out that this doesn't catch the all cases; namely, this warned
only when a PCM stream is attached onto the existing PCM instance, but
it doesn't count for a newly created PCM instance.  This made
confusion as if there were no further delayed registration.

This patch moves the check to the code path for either adding a stream
or creating a PCM instance.  Also, make it simpler by checking the
card->registered flag instead of querying each snd_device state.

Fixes: a4aad5636c72 ("ALSA: usb-audio: Inform devices that need delayed registration")
Link: https://bugzilla.kernel.org/show_bug.cgi?id=216082
Link: https://lore.kernel.org/r/20220831125901.4660-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
sound/usb/stream.c