diff options
author | Geoffrey D. Bennett <g@b4.vu> | 2021-06-21 02:16:41 +0930 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2021-06-21 08:37:30 +0200 |
commit | 3eeb2a19dba65fe63dd755e3209831312e0ad9ed (patch) | |
tree | 821e4dc6b8e56c8782b288ca8f478cb998733e4e /sound/usb | |
parent | e46f2195c86b008b678364e33c3efda7d533de18 (diff) |
ALSA: usb-audio: scarlett2: Add temp variable for consistency
Add index temporary variable to scarlett2_mixer_ctl_put() for
consistency with the other *_ctl_put() functions.
Signed-off-by: Geoffrey D. Bennett <g@b4.vu>
Link: https://lore.kernel.org/r/20210620164641.GA9211@m.b4.vu
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/usb')
-rw-r--r-- | sound/usb/mixer_scarlett_gen2.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/sound/usb/mixer_scarlett_gen2.c b/sound/usb/mixer_scarlett_gen2.c index c1e74918425a..cb8483d3c58a 100644 --- a/sound/usb/mixer_scarlett_gen2.c +++ b/sound/usb/mixer_scarlett_gen2.c @@ -1622,18 +1622,19 @@ static int scarlett2_mixer_ctl_put(struct snd_kcontrol *kctl, const struct scarlett2_device_info *info = private->info; const struct scarlett2_ports *ports = info->ports; int oval, val, num_mixer_in, mix_num, err = 0; + int index = elem->control; mutex_lock(&private->data_mutex); - oval = private->mix[elem->control]; + oval = private->mix[index]; val = ucontrol->value.integer.value[0]; num_mixer_in = ports[SCARLETT2_PORT_TYPE_MIX].num[SCARLETT2_PORT_OUT]; - mix_num = elem->control / num_mixer_in; + mix_num = index / num_mixer_in; if (oval == val) goto unlock; - private->mix[elem->control] = val; + private->mix[index] = val; err = scarlett2_usb_set_mix(mixer, mix_num); if (err == 0) err = 1; |