ALSA: scarlett2: Add missing error check to scarlett2_config_save()
authorGeoffrey D. Bennett <g@b4.vu>
Tue, 19 Dec 2023 17:37:00 +0000 (04:07 +1030)
committerTakashi Iwai <tiwai@suse.de>
Fri, 29 Dec 2023 14:39:27 +0000 (15:39 +0100)
scarlett2_config_save() was ignoring the return value from
scarlett2_usb(). As this function is not called from user-space we
can't return the error, so call usb_audio_err() instead.

Signed-off-by: Geoffrey D. Bennett <g@b4.vu>
Fixes: 9e4d5c1be21f ("ALSA: usb-audio: Scarlett Gen 2 mixer interface")
Link: https://lore.kernel.org/r/bf0a15332d852d7825fa6da87d2a0d9c0b702053.1703001053.git.g@b4.vu
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/usb/mixer_scarlett2.c

index 51f5471d3fdab17a4258d4d96a87fbcaa77de128..0f38301dd3d560d15c3f90ff586baffbbb733835 100644 (file)
@@ -1524,9 +1524,11 @@ static void scarlett2_config_save(struct usb_mixer_interface *mixer)
 {
        __le32 req = cpu_to_le32(SCARLETT2_USB_CONFIG_SAVE);
 
-       scarlett2_usb(mixer, SCARLETT2_USB_DATA_CMD,
-                     &req, sizeof(u32),
-                     NULL, 0);
+       int err = scarlett2_usb(mixer, SCARLETT2_USB_DATA_CMD,
+                               &req, sizeof(u32),
+                               NULL, 0);
+       if (err < 0)
+               usb_audio_err(mixer->chip, "config save failed: %d\n", err);
 }
 
 /* Delayed work to save config */