summaryrefslogtreecommitdiff
path: root/sound/usb/mixer_quirks.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2018-05-03 13:33:32 +0300
committerTakashi Iwai <tiwai@suse.de>2018-05-03 13:35:19 +0300
commit8c558076c740e8009a96c6fdc3d4245dde62be77 (patch)
tree361e87f1a346bff4a243a2538fb109665978317b /sound/usb/mixer_quirks.c
parent207459a2804a64d0f0f05c8aba04e0b0844661f2 (diff)
downloadlinux-8c558076c740e8009a96c6fdc3d4245dde62be77.tar.xz
ALSA: usb-audio: Clean up mixer element list traverse
Introduce a new macro for iterating over mixer element list for avoiding the open codes in many places. Also the open-coded container_of() and the forced cast to struct usb_mixer_elem_info are replaced with another simple macro, too. No functional changes but just readability improvement. Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/usb/mixer_quirks.c')
-rw-r--r--sound/usb/mixer_quirks.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sound/usb/mixer_quirks.c b/sound/usb/mixer_quirks.c
index 4377374affd3..1b94387e18b6 100644
--- a/sound/usb/mixer_quirks.c
+++ b/sound/usb/mixer_quirks.c
@@ -1172,7 +1172,7 @@ void snd_emuusb_set_samplerate(struct snd_usb_audio *chip,
int unitid = 12; /* SamleRate ExtensionUnit ID */
list_for_each_entry(mixer, &chip->mixer_list, list) {
- cval = (struct usb_mixer_elem_info *)mixer->id_elems[unitid];
+ cval = mixer_elem_list_to_info(mixer->id_elems[unitid]);
if (cval) {
snd_usb_mixer_set_ctl_value(cval, UAC_SET_CUR,
cval->control << 8,