diff options
author | Takashi Iwai <tiwai@suse.de> | 2012-04-18 07:57:32 +0200 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2012-04-18 07:57:32 +0200 |
commit | 56599bb0208fa0ae6e58d3c304a851149973e48d (patch) | |
tree | b3d500ae4415ef2f8e931af9f995f522c6623c4a /sound/usb/card.c | |
parent | 7536c301f8817214629e80fa06b5b5c93df3ad52 (diff) | |
parent | 22026c1a7be900cc6dabd6be37a77bb217d2d837 (diff) | |
download | op-kernel-dev-56599bb0208fa0ae6e58d3c304a851149973e48d.zip op-kernel-dev-56599bb0208fa0ae6e58d3c304a851149973e48d.tar.gz |
Merge branch 'topic/usb-endpoint' into topic/misc
Diffstat (limited to 'sound/usb/card.c')
-rw-r--r-- | sound/usb/card.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/sound/usb/card.c b/sound/usb/card.c index 4a7be7b..d5b5c33 100644 --- a/sound/usb/card.c +++ b/sound/usb/card.c @@ -131,8 +131,9 @@ static void snd_usb_stream_disconnect(struct list_head *head) subs = &as->substream[idx]; if (!subs->num_formats) continue; - snd_usb_release_substream_urbs(subs, 1); subs->interface = -1; + subs->data_endpoint = NULL; + subs->sync_endpoint = NULL; } } @@ -276,6 +277,7 @@ static int snd_usb_create_streams(struct snd_usb_audio *chip, int ctrlif) static int snd_usb_audio_free(struct snd_usb_audio *chip) { + mutex_destroy(&chip->mutex); kfree(chip); return 0; } @@ -336,6 +338,7 @@ static int snd_usb_audio_create(struct usb_device *dev, int idx, return -ENOMEM; } + mutex_init(&chip->mutex); mutex_init(&chip->shutdown_mutex); chip->index = idx; chip->dev = dev; @@ -348,6 +351,7 @@ static int snd_usb_audio_create(struct usb_device *dev, int idx, chip->usb_id = USB_ID(le16_to_cpu(dev->descriptor.idVendor), le16_to_cpu(dev->descriptor.idProduct)); INIT_LIST_HEAD(&chip->pcm_list); + INIT_LIST_HEAD(&chip->ep_list); INIT_LIST_HEAD(&chip->midi_list); INIT_LIST_HEAD(&chip->mixer_list); @@ -565,6 +569,10 @@ static void snd_usb_audio_disconnect(struct usb_device *dev, list_for_each(p, &chip->pcm_list) { snd_usb_stream_disconnect(p); } + /* release the endpoint resources */ + list_for_each(p, &chip->ep_list) { + snd_usb_endpoint_free(p); + } /* release the midi resources */ list_for_each(p, &chip->midi_list) { snd_usbmidi_disconnect(p); |