diff options
author | Takashi Iwai <tiwai@suse.de> | 2014-11-05 15:37:22 +0100 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2014-11-05 15:37:22 +0100 |
commit | 19566b0bd93c34e4941822ed3c0d76a5abddcf82 (patch) | |
tree | 7e1894610584133feb4ee6e08bb3e05eb3d6acc1 /sound/usb/card.c | |
parent | 9161bd0d1cf375492f0a6aa86b3e4c28b070fb7c (diff) | |
parent | 0725dda207e95ff25f1aa01432250323e0ec49d6 (diff) | |
download | op-kernel-dev-19566b0bd93c34e4941822ed3c0d76a5abddcf82.zip op-kernel-dev-19566b0bd93c34e4941822ed3c0d76a5abddcf82.tar.gz |
Merge branch 'for-linus' into for-next
This merges the USB-audio disconnect fix and resolves the conflicts
so that we can continue working on development of usb-audio stuff.
Conflicts:
sound/usb/card.c
Diffstat (limited to 'sound/usb/card.c')
-rw-r--r-- | sound/usb/card.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/sound/usb/card.c b/sound/usb/card.c index 69725d5..1fab977 100644 --- a/sound/usb/card.c +++ b/sound/usb/card.c @@ -585,18 +585,19 @@ static void usb_audio_disconnect(struct usb_interface *intf) struct snd_usb_audio *chip = usb_get_intfdata(intf); struct snd_card *card; struct list_head *p; + bool was_shutdown; if (chip == (void *)-1L) return; card = chip->card; down_write(&chip->shutdown_rwsem); + was_shutdown = chip->shutdown; chip->shutdown = 1; up_write(&chip->shutdown_rwsem); mutex_lock(®ister_mutex); - chip->num_interfaces--; - if (chip->num_interfaces <= 0) { + if (!was_shutdown) { struct snd_usb_stream *as; struct snd_usb_endpoint *ep; struct usb_mixer_interface *mixer; @@ -618,6 +619,10 @@ static void usb_audio_disconnect(struct usb_interface *intf) list_for_each_entry(mixer, &chip->mixer_list, list) { snd_usb_mixer_disconnect(mixer); } + } + + chip->num_interfaces--; + if (chip->num_interfaces <= 0) { usb_chip[chip->index] = NULL; mutex_unlock(®ister_mutex); snd_card_free_when_closed(card); |