aboutsummaryrefslogtreecommitdiffstats
path: root/sound/usb/mixer_quirks.c
diff options
context:
space:
mode:
authorDaniel Mack <daniel@caiaq.de>2011-02-11 06:34:12 -0500
committerTakashi Iwai <tiwai@suse.de>2011-02-14 11:11:12 -0500
commit3347b26cab60e20534b9a46ceea70b9fb74297fb (patch)
tree6a7552d7a492ea9c9ce34ca6e20f82b6696b6aa8 /sound/usb/mixer_quirks.c
parent54a8c500d5b80c83e0f14cbcfcfd4a84abff8a80 (diff)
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.c41
1 files changed, 18 insertions, 23 deletions
diff --git a/sound/usb/mixer_quirks.c b/sound/usb/mixer_quirks.c
index 3fe612a369a..73dcc8256bc 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,
502 502
503int snd_usb_mixer_apply_create_quirk(struct usb_mixer_interface *mixer) 503int snd_usb_mixer_apply_create_quirk(struct usb_mixer_interface *mixer)
504{ 504{
505 int err; 505 int err = 0;
506 struct snd_info_entry *entry; 506 struct snd_info_entry *entry;
507 507
508 if ((err = snd_usb_soundblaster_remote_init(mixer)) < 0) 508 if ((err = snd_usb_soundblaster_remote_init(mixer)) < 0)
509 return err; 509 return err;
510 510
511 if (mixer->chip->usb_id == USB_ID(0x041e, 0x3020) || 511 switch (mixer->chip->usb_id) {
512 mixer->chip->usb_id == USB_ID(0x041e, 0x3040) || 512 case USB_ID(0x041e, 0x3020):
513 mixer->chip->usb_id == USB_ID(0x041e, 0x3042) || 513 case USB_ID(0x041e, 0x3040):
514 mixer->chip->usb_id == USB_ID(0x041e, 0x3048)) { 514 case USB_ID(0x041e, 0x3042):
515 if ((err = snd_audigy2nx_controls_create(mixer)) < 0) 515 case USB_ID(0x041e, 0x3048):
516 return err; 516 err = snd_audigy2nx_controls_create(mixer);
517 if (err < 0)
518 break;
517 if (!snd_card_proc_new(mixer->chip->card, "audigy2nx", &entry)) 519 if (!snd_card_proc_new(mixer->chip->card, "audigy2nx", &entry))
518 snd_info_set_text_ops(entry, mixer, 520 snd_info_set_text_ops(entry, mixer,
519 snd_audigy2nx_proc_read); 521 snd_audigy2nx_proc_read);
520 } 522 break;
521 523
522 if (mixer->chip->usb_id == USB_ID(0x0b05, 0x1739) || 524 case USB_ID(0x0b05, 0x1739):
523 mixer->chip->usb_id == USB_ID(0x0b05, 0x1743)) { 525 case USB_ID(0x0b05, 0x1743):
524 err = snd_xonar_u1_controls_create(mixer); 526 err = snd_xonar_u1_controls_create(mixer);
525 if (err < 0) 527 break;
526 return err;
527 }
528 528
529 /* Traktor Audio 6 */ 529 case USB_ID(0x17cc, 0x1011): /* Traktor Audio 6 */
530 if (mixer->chip->usb_id == USB_ID(0x17cc, 0x1011)) {
531 err = snd_nativeinstruments_create_mixer(mixer, 530 err = snd_nativeinstruments_create_mixer(mixer,
532 snd_nativeinstruments_ta6_mixers, 531 snd_nativeinstruments_ta6_mixers,
533 ARRAY_SIZE(snd_nativeinstruments_ta6_mixers)); 532 ARRAY_SIZE(snd_nativeinstruments_ta6_mixers));
534 if (err < 0) 533 break;
535 return err;
536 }
537 534
538 /* Traktor Audio 10 */ 535 case USB_ID(0x17cc, 0x1021): /* Traktor Audio 10 */
539 if (mixer->chip->usb_id == USB_ID(0x17cc, 0x1021)) {
540 err = snd_nativeinstruments_create_mixer(mixer, 536 err = snd_nativeinstruments_create_mixer(mixer,
541 snd_nativeinstruments_ta10_mixers, 537 snd_nativeinstruments_ta10_mixers,
542 ARRAY_SIZE(snd_nativeinstruments_ta10_mixers)); 538 ARRAY_SIZE(snd_nativeinstruments_ta10_mixers));
543 if (err < 0) 539 break;
544 return err;
545 } 540 }
546 541
547 return 0; 542 return err;
548} 543}
549 544
550void snd_usb_mixer_rc_memory_change(struct usb_mixer_interface *mixer, 545void snd_usb_mixer_rc_memory_change(struct usb_mixer_interface *mixer,