Skip to content

Commit

Permalink
ALSA: usb-audio: scarlett2: Fix scarlett2_*_ctl_put() return values
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
geoffreybennett authored and tiwai committed Jun 21, 2021
1 parent 9b5ddea commit c5d8e00
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions sound/usb/mixer_scarlett_gen2.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit c5d8e00

Please sign in to comment.