Skip to content

Commit 75cdae4

Browse files
royvegardtiwai
authored andcommitted
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: 0805645 ("ALSA: usb-audio: enable support for Presonus Studio 1824c within 1810c file") Signed-off-by: Roy Vegard Ovesen <[email protected]> Link: https://patch.msgid.link/aPaYTP7ceuABf8c7@ark Signed-off-by: Takashi Iwai <[email protected]>
1 parent 7963891 commit 75cdae4

File tree

1 file changed

+18
-15
lines changed

1 file changed

+18
-15
lines changed

sound/usb/mixer_s1810c.c

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -597,15 +597,6 @@ int snd_sc1810_init_mixer(struct usb_mixer_interface *mixer)
597597
if (!list_empty(&chip->mixer_list))
598598
return 0;
599599

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-
609600
ret = snd_s1810c_init_mixer_maps(chip);
610601
if (ret < 0)
611602
return ret;
@@ -634,16 +625,28 @@ int snd_sc1810_init_mixer(struct usb_mixer_interface *mixer)
634625
if (ret < 0)
635626
return ret;
636627

637-
// The 1824c has a Mono Main switch instead of a
638-
// A/B select switch.
639-
if (mixer->chip->usb_id == USB_ID(0x194f, 0x010d)) {
640-
ret = snd_s1810c_switch_init(mixer, &snd_s1824c_mono_sw);
628+
switch (chip->usb_id) {
629+
case USB_ID(0x194f, 0x010c): /* Presonus Studio 1810c */
630+
dev_info(&dev->dev,
631+
"Presonus Studio 1810c, device_setup: %u\n", chip->setup);
632+
if (chip->setup == 1)
633+
dev_info(&dev->dev, "(8out/18in @ 48kHz)\n");
634+
else if (chip->setup == 2)
635+
dev_info(&dev->dev, "(6out/8in @ 192kHz)\n");
636+
else
637+
dev_info(&dev->dev, "(8out/14in @ 96kHz)\n");
638+
639+
ret = snd_s1810c_switch_init(mixer, &snd_s1810c_ab_sw);
641640
if (ret < 0)
642641
return ret;
643-
} else if (mixer->chip->usb_id == USB_ID(0x194f, 0x010c)) {
644-
ret = snd_s1810c_switch_init(mixer, &snd_s1810c_ab_sw);
642+
643+
break;
644+
case USB_ID(0x194f, 0x010d): /* Presonus Studio 1824c */
645+
ret = snd_s1810c_switch_init(mixer, &snd_s1824c_mono_sw);
645646
if (ret < 0)
646647
return ret;
648+
649+
break;
647650
}
648651

649652
return ret;

0 commit comments

Comments
 (0)