Commit 4dedf7ca authored by Geoffrey D. Bennett's avatar Geoffrey D. Bennett Committed by Takashi Iwai

ALSA: scarlett2: Remove repeated elem->head.mixer references

Use a local variable *mixer rather than repeating elem->header.mixer
in scarlett2_direct_monitor_ctl_get() and scarlett2_meter_ctl_get().
Signed-off-by: default avatarGeoffrey D. Bennett <g@b4.vu>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/b21bacf4056366e10e01077e224d2b4970fdfe31.1703612638.git.g@b4.vu
parent d3cf557b
...@@ -3927,7 +3927,7 @@ static int scarlett2_direct_monitor_ctl_get( ...@@ -3927,7 +3927,7 @@ static int scarlett2_direct_monitor_ctl_get(
{ {
struct usb_mixer_elem_info *elem = kctl->private_data; struct usb_mixer_elem_info *elem = kctl->private_data;
struct usb_mixer_interface *mixer = elem->head.mixer; struct usb_mixer_interface *mixer = elem->head.mixer;
struct scarlett2_data *private = elem->head.mixer->private_data; struct scarlett2_data *private = mixer->private_data;
int err = 0; int err = 0;
mutex_lock(&private->data_mutex); mutex_lock(&private->data_mutex);
...@@ -4191,7 +4191,8 @@ static int scarlett2_meter_ctl_get(struct snd_kcontrol *kctl, ...@@ -4191,7 +4191,8 @@ static int scarlett2_meter_ctl_get(struct snd_kcontrol *kctl,
struct snd_ctl_elem_value *ucontrol) struct snd_ctl_elem_value *ucontrol)
{ {
struct usb_mixer_elem_info *elem = kctl->private_data; struct usb_mixer_elem_info *elem = kctl->private_data;
struct scarlett2_data *private = elem->head.mixer->private_data; struct usb_mixer_interface *mixer = elem->head.mixer;
struct scarlett2_data *private = mixer->private_data;
u8 *meter_level_map = private->meter_level_map; u8 *meter_level_map = private->meter_level_map;
u16 meter_levels[SCARLETT2_MAX_METERS]; u16 meter_levels[SCARLETT2_MAX_METERS];
int i, err; int i, err;
...@@ -4203,7 +4204,7 @@ static int scarlett2_meter_ctl_get(struct snd_kcontrol *kctl, ...@@ -4203,7 +4204,7 @@ static int scarlett2_meter_ctl_get(struct snd_kcontrol *kctl,
goto unlock; goto unlock;
} }
err = scarlett2_usb_get_meter_levels(elem->head.mixer, elem->channels, err = scarlett2_usb_get_meter_levels(mixer, elem->channels,
meter_levels); meter_levels);
if (err < 0) if (err < 0)
goto unlock; goto unlock;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment