ALSA: usb-audio: reconstruct some dispatcher functions to use switch-case

The number of cases has increased so use switch-case rather than
if-statements.

Signed-off-by: Daniel Mack <daniel@caiaq.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
Daniel Mack
2011-02-11 11:34:12 +00:00
committed by Takashi Iwai
parent 54a8c500d5
commit 3347b26cab
2 changed files with 33 additions and 37 deletions

View File

@@ -517,31 +517,32 @@ int snd_usb_apply_boot_quirk(struct usb_device *dev,
u32 id = USB_ID(le16_to_cpu(dev->descriptor.idVendor),
le16_to_cpu(dev->descriptor.idProduct));
/* SB Extigy needs special boot-up sequence */
/* if more models come, this will go to the quirk list. */
if (id == USB_ID(0x041e, 0x3000))
switch (id) {
case USB_ID(0x041e, 0x3000):
/* SB Extigy needs special boot-up sequence */
/* if more models come, this will go to the quirk list. */
return snd_usb_extigy_boot_quirk(dev, intf);
/* SB Audigy 2 NX needs its own boot-up magic, too */
if (id == USB_ID(0x041e, 0x3020))
case USB_ID(0x041e, 0x3020):
/* SB Audigy 2 NX needs its own boot-up magic, too */
return snd_usb_audigy2nx_boot_quirk(dev);
/* C-Media CM106 / Turtle Beach Audio Advantage Roadie */
if (id == USB_ID(0x10f5, 0x0200))
case USB_ID(0x10f5, 0x0200):
/* C-Media CM106 / Turtle Beach Audio Advantage Roadie */
return snd_usb_cm106_boot_quirk(dev);
/* C-Media CM6206 / CM106-Like Sound Device */
if (id == USB_ID(0x0d8c, 0x0102))
case USB_ID(0x0d8c, 0x0102):
/* C-Media CM6206 / CM106-Like Sound Device */
return snd_usb_cm6206_boot_quirk(dev);
/* Access Music VirusTI Desktop */
if (id == USB_ID(0x133e, 0x0815))
case USB_ID(0x133e, 0x0815):
/* Access Music VirusTI Desktop */
return snd_usb_accessmusic_boot_quirk(dev);
/* Native Instruments Devices */
if (id == USB_ID(0x17cc, 0x1010) || /* Traktor Audio 6 */
id == USB_ID(0x17cc, 0x1020)) /* Traktor Audio 10 */
case USB_ID(0x17cc, 0x1010): /* Traktor Audio 6 */
case USB_ID(0x17cc, 0x1020): /* Traktor Audio 10 */
return snd_usb_nativeinstruments_boot_quirk(dev);
}
return 0;
}