diff options
author | Daniel Mack <daniel@caiaq.de> | 2011-02-11 11:34:12 +0000 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2011-02-14 17:11:12 +0100 |
commit | 3347b26cab60e20534b9a46ceea70b9fb74297fb (patch) | |
tree | 6a7552d7a492ea9c9ce34ca6e20f82b6696b6aa8 /sound/usb/quirks.c | |
parent | 54a8c500d5b80c83e0f14cbcfcfd4a84abff8a80 (diff) | |
download | linux-3347b26cab60e20534b9a46ceea70b9fb74297fb.tar.bz2 |
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>
Diffstat (limited to 'sound/usb/quirks.c')
-rw-r--r-- | sound/usb/quirks.c | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/sound/usb/quirks.c b/sound/usb/quirks.c index e55bd1cac77d..ca860e611263 100644 --- a/sound/usb/quirks.c +++ b/sound/usb/quirks.c @@ -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; } |