[ALSA] usb-audio - move mixer data into separate struct
USB generic driver
Move all data related to audio control interfaces into a separate struct
local to usbmixer.c.
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
diff --git a/sound/usb/usbaudio.c b/sound/usb/usbaudio.c
index e4b9104..eeb09bb 100644
--- a/sound/usb/usbaudio.c
+++ b/sound/usb/usbaudio.c
@@ -3091,6 +3091,7 @@
chip->card = card;
INIT_LIST_HEAD(&chip->pcm_list);
INIT_LIST_HEAD(&chip->midi_list);
+ INIT_LIST_HEAD(&chip->mixer_list);
if ((err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, chip, &ops)) < 0) {
snd_usb_audio_free(chip);
@@ -3290,6 +3291,10 @@
list_for_each(p, &chip->midi_list) {
snd_usbmidi_disconnect(p);
}
+ /* release mixer resources */
+ list_for_each(p, &chip->mixer_list) {
+ snd_usb_mixer_disconnect(p);
+ }
usb_chip[chip->index] = NULL;
up(®ister_mutex);
snd_card_free(card);