ALSA: usb-audio: Rewrite registration quirk handling

A slight refactoring of the registration quirk code.  Now it uses the
table lookup for easy additions in future.  Also the return type was
changed to bool, and got a few more comments.

Link: https://lore.kernel.org/r/20200325103322.2508-2-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
这个提交包含在:
Takashi Iwai
2020-03-25 11:33:19 +01:00
父节点 c208a53350
当前提交 d8695bc5b1
修改 3 个文件,包含 32 行新增13 行删除

查看文件

@@ -665,7 +665,7 @@ static int usb_audio_probe(struct usb_interface *intf,
/* we are allowed to call snd_card_register() many times, but first
* check to see if a device needs to skip it or do anything special
*/
if (snd_usb_registration_quirk(chip, ifnum) == 0) {
if (!snd_usb_registration_quirk(chip, ifnum)) {
err = snd_card_register(chip->card);
if (err < 0)
goto __error;