Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ALSA: usb-audio: don't log messages meant for 1810c when initializing 1824c

The log messages for the PreSonus STUDIO 1810c about
device_setup are not applicable to the 1824c, and should
not be logged when 1824c initializes.

Refactor from if statement to switch statement as there
might be more STUDIO series devices added later.

Fixes: 080564558eb1 ("ALSA: usb-audio: enable support for Presonus Studio 1824c within 1810c file")
Signed-off-by: Roy Vegard Ovesen <roy.vegard.ovesen@gmail.com>
Link: https://patch.msgid.link/aPaYTP7ceuABf8c7@ark
Signed-off-by: Takashi Iwai <tiwai@suse.de>

authored by

Roy Vegard Ovesen and committed by
Takashi Iwai
75cdae44 7963891f

+19 -16
+19 -16
sound/usb/mixer_s1810c.c
··· 597 597 if (!list_empty(&chip->mixer_list)) 598 598 return 0; 599 599 600 - dev_info(&dev->dev, 601 - "Presonus Studio 1810c, device_setup: %u\n", chip->setup); 602 - if (chip->setup == 1) 603 - dev_info(&dev->dev, "(8out/18in @ 48kHz)\n"); 604 - else if (chip->setup == 2) 605 - dev_info(&dev->dev, "(6out/8in @ 192kHz)\n"); 606 - else 607 - dev_info(&dev->dev, "(8out/14in @ 96kHz)\n"); 608 - 609 600 ret = snd_s1810c_init_mixer_maps(chip); 610 601 if (ret < 0) 611 602 return ret; ··· 625 634 if (ret < 0) 626 635 return ret; 627 636 628 - // The 1824c has a Mono Main switch instead of a 629 - // A/B select switch. 630 - if (mixer->chip->usb_id == USB_ID(0x194f, 0x010d)) { 631 - ret = snd_s1810c_switch_init(mixer, &snd_s1824c_mono_sw); 632 - if (ret < 0) 633 - return ret; 634 - } else if (mixer->chip->usb_id == USB_ID(0x194f, 0x010c)) { 637 + switch (chip->usb_id) { 638 + case USB_ID(0x194f, 0x010c): /* Presonus Studio 1810c */ 639 + dev_info(&dev->dev, 640 + "Presonus Studio 1810c, device_setup: %u\n", chip->setup); 641 + if (chip->setup == 1) 642 + dev_info(&dev->dev, "(8out/18in @ 48kHz)\n"); 643 + else if (chip->setup == 2) 644 + dev_info(&dev->dev, "(6out/8in @ 192kHz)\n"); 645 + else 646 + dev_info(&dev->dev, "(8out/14in @ 96kHz)\n"); 647 + 635 648 ret = snd_s1810c_switch_init(mixer, &snd_s1810c_ab_sw); 636 649 if (ret < 0) 637 650 return ret; 651 + 652 + break; 653 + case USB_ID(0x194f, 0x010d): /* Presonus Studio 1824c */ 654 + ret = snd_s1810c_switch_init(mixer, &snd_s1824c_mono_sw); 655 + if (ret < 0) 656 + return ret; 657 + 658 + break; 638 659 } 639 660 640 661 return ret;