]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
ALSA: usb-audio: don't log messages meant for 1810c when initializing 1824c
authorRoy Vegard Ovesen <roy.vegard.ovesen@gmail.com>
Mon, 20 Oct 2025 20:15:08 +0000 (22:15 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 13 Nov 2025 20:36:41 +0000 (15:36 -0500)
[ Upstream commit 75cdae446ddffe0a6a991bbb146dee51d9d4c865 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
sound/usb/mixer_s1810c.c

index 2413a6d96971cbaf5dd4767d92d0643b14f90674..5b187f89c7f8eb86f44ffe77e850622aa0f0b31d 100644 (file)
@@ -562,15 +562,6 @@ int snd_sc1810_init_mixer(struct usb_mixer_interface *mixer)
        if (!list_empty(&chip->mixer_list))
                return 0;
 
-       dev_info(&dev->dev,
-                "Presonus Studio 1810c, device_setup: %u\n", chip->setup);
-       if (chip->setup == 1)
-               dev_info(&dev->dev, "(8out/18in @ 48kHz)\n");
-       else if (chip->setup == 2)
-               dev_info(&dev->dev, "(6out/8in @ 192kHz)\n");
-       else
-               dev_info(&dev->dev, "(8out/14in @ 96kHz)\n");
-
        ret = snd_s1810c_init_mixer_maps(chip);
        if (ret < 0)
                return ret;
@@ -599,16 +590,28 @@ int snd_sc1810_init_mixer(struct usb_mixer_interface *mixer)
        if (ret < 0)
                return ret;
 
-       // The 1824c has a Mono Main switch instead of a
-       // A/B select switch.
-       if (mixer->chip->usb_id == USB_ID(0x194f, 0x010d)) {
-               ret = snd_s1810c_switch_init(mixer, &snd_s1824c_mono_sw);
+       switch (chip->usb_id) {
+       case USB_ID(0x194f, 0x010c): /* Presonus Studio 1810c */
+               dev_info(&dev->dev,
+                        "Presonus Studio 1810c, device_setup: %u\n", chip->setup);
+               if (chip->setup == 1)
+                       dev_info(&dev->dev, "(8out/18in @ 48kHz)\n");
+               else if (chip->setup == 2)
+                       dev_info(&dev->dev, "(6out/8in @ 192kHz)\n");
+               else
+                       dev_info(&dev->dev, "(8out/14in @ 96kHz)\n");
+
+               ret = snd_s1810c_switch_init(mixer, &snd_s1810c_ab_sw);
                if (ret < 0)
                        return ret;
-       } else if (mixer->chip->usb_id == USB_ID(0x194f, 0x010c)) {
-               ret = snd_s1810c_switch_init(mixer, &snd_s1810c_ab_sw);
+
+               break;
+       case USB_ID(0x194f, 0x010d): /* Presonus Studio 1824c */
+               ret = snd_s1810c_switch_init(mixer, &snd_s1824c_mono_sw);
                if (ret < 0)
                        return ret;
+
+               break;
        }
 
        return ret;