aboutsummaryrefslogtreecommitdiffstats
path: root/sound/usb/mixer_scarlett_gen2.c
diff options
context:
space:
mode:
authorGeoffrey D. Bennett <g@b4.vu>2021-06-21 02:16:45 +0930
committerTakashi Iwai <tiwai@suse.de>2021-06-21 08:37:50 +0200
commitc5d8e008032f3cd5f266d552732973a960b0bd4b (patch)
treef9235aa2cde66c1d54da901cd7af90090445b6e0 /sound/usb/mixer_scarlett_gen2.c
parentALSA: usb-audio: scarlett2: Fix data_mutex lock (diff)
downloadlinux-dev-c5d8e008032f3cd5f266d552732973a960b0bd4b.tar.xz
linux-dev-c5d8e008032f3cd5f266d552732973a960b0bd4b.zip
ALSA: usb-audio: scarlett2: Fix scarlett2_*_ctl_put() return values
Mixer control put callbacks should return 1 if the value is changed. Fix the sw_hw, level, pad, and button controls accordingly. Signed-off-by: Geoffrey D. Bennett <g@b4.vu> Link: https://lore.kernel.org/r/20210620164645.GA9221@m.b4.vu Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/usb/mixer_scarlett_gen2.c')
-rw-r--r--sound/usb/mixer_scarlett_gen2.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/sound/usb/mixer_scarlett_gen2.c b/sound/usb/mixer_scarlett_gen2.c
index d6298ab1de56..fe142b7ddb32 100644
--- a/sound/usb/mixer_scarlett_gen2.c
+++ b/sound/usb/mixer_scarlett_gen2.c
@@ -1304,6 +1304,8 @@ static int scarlett2_sw_hw_enum_ctl_put(struct snd_kcontrol *kctl,
/* Send SW/HW switch change to the device */
err = scarlett2_usb_set_config(mixer, SCARLETT2_CONFIG_SW_HW_SWITCH,
index, val);
+ if (err == 0)
+ err = 1;
unlock:
mutex_unlock(&private->data_mutex);
@@ -1364,6 +1366,8 @@ static int scarlett2_level_enum_ctl_put(struct snd_kcontrol *kctl,
/* Send switch change to the device */
err = scarlett2_usb_set_config(mixer, SCARLETT2_CONFIG_LEVEL_SWITCH,
index, val);
+ if (err == 0)
+ err = 1;
unlock:
mutex_unlock(&private->data_mutex);
@@ -1414,6 +1418,8 @@ static int scarlett2_pad_ctl_put(struct snd_kcontrol *kctl,
/* Send switch change to the device */
err = scarlett2_usb_set_config(mixer, SCARLETT2_CONFIG_PAD_SWITCH,
index, val);
+ if (err == 0)
+ err = 1;
unlock:
mutex_unlock(&private->data_mutex);
@@ -1469,6 +1475,8 @@ static int scarlett2_dim_mute_ctl_put(struct snd_kcontrol *kctl,
/* Send switch change to the device */
err = scarlett2_usb_set_config(mixer, SCARLETT2_CONFIG_DIM_MUTE,
index, val);
+ if (err == 0)
+ err = 1;
unlock:
mutex_unlock(&private->data_mutex);