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/mixer_quirks.c | |
parent | 54a8c500d5b80c83e0f14cbcfcfd4a84abff8a80 (diff) | |
download | kernel_samsung_smdk4412-3347b26cab60e20534b9a46ceea70b9fb74297fb.zip kernel_samsung_smdk4412-3347b26cab60e20534b9a46ceea70b9fb74297fb.tar.gz kernel_samsung_smdk4412-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/mixer_quirks.c')
-rw-r--r-- | sound/usb/mixer_quirks.c | 41 |
1 files changed, 18 insertions, 23 deletions
diff --git a/sound/usb/mixer_quirks.c b/sound/usb/mixer_quirks.c index 3fe612a..73dcc82 100644 --- a/sound/usb/mixer_quirks.c +++ b/sound/usb/mixer_quirks.c @@ -502,49 +502,44 @@ void snd_emuusb_set_samplerate(struct snd_usb_audio *chip, int snd_usb_mixer_apply_create_quirk(struct usb_mixer_interface *mixer) { - int err; + int err = 0; struct snd_info_entry *entry; if ((err = snd_usb_soundblaster_remote_init(mixer)) < 0) return err; - if (mixer->chip->usb_id == USB_ID(0x041e, 0x3020) || - mixer->chip->usb_id == USB_ID(0x041e, 0x3040) || - mixer->chip->usb_id == USB_ID(0x041e, 0x3042) || - mixer->chip->usb_id == USB_ID(0x041e, 0x3048)) { - if ((err = snd_audigy2nx_controls_create(mixer)) < 0) - return err; + switch (mixer->chip->usb_id) { + case USB_ID(0x041e, 0x3020): + case USB_ID(0x041e, 0x3040): + case USB_ID(0x041e, 0x3042): + case USB_ID(0x041e, 0x3048): + err = snd_audigy2nx_controls_create(mixer); + if (err < 0) + break; if (!snd_card_proc_new(mixer->chip->card, "audigy2nx", &entry)) snd_info_set_text_ops(entry, mixer, snd_audigy2nx_proc_read); - } + break; - if (mixer->chip->usb_id == USB_ID(0x0b05, 0x1739) || - mixer->chip->usb_id == USB_ID(0x0b05, 0x1743)) { + case USB_ID(0x0b05, 0x1739): + case USB_ID(0x0b05, 0x1743): err = snd_xonar_u1_controls_create(mixer); - if (err < 0) - return err; - } + break; - /* Traktor Audio 6 */ - if (mixer->chip->usb_id == USB_ID(0x17cc, 0x1011)) { + case USB_ID(0x17cc, 0x1011): /* Traktor Audio 6 */ err = snd_nativeinstruments_create_mixer(mixer, snd_nativeinstruments_ta6_mixers, ARRAY_SIZE(snd_nativeinstruments_ta6_mixers)); - if (err < 0) - return err; - } + break; - /* Traktor Audio 10 */ - if (mixer->chip->usb_id == USB_ID(0x17cc, 0x1021)) { + case USB_ID(0x17cc, 0x1021): /* Traktor Audio 10 */ err = snd_nativeinstruments_create_mixer(mixer, snd_nativeinstruments_ta10_mixers, ARRAY_SIZE(snd_nativeinstruments_ta10_mixers)); - if (err < 0) - return err; + break; } - return 0; + return err; } void snd_usb_mixer_rc_memory_change(struct usb_mixer_interface *mixer, |