Merge branch 'for-linus' into for-next
authorTakashi Iwai <tiwai@suse.de>
Wed, 5 Nov 2014 14:37:22 +0000 (15:37 +0100)
committerTakashi Iwai <tiwai@suse.de>
Wed, 5 Nov 2014 14:37:22 +0000 (15:37 +0100)
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

1  2 
sound/usb/card.c

index 69725d5fa2d6e054dcced81e2bed4cd6ab319624,f61ebb17cc64e3dd33aadd41185e00ea460ebbe9..1fab9778807a0015f2578f0504306ed852eb4932
@@@ -580,11 -586,12 +580,12 @@@ static int usb_audio_probe(struct usb_i
   * we need to take care of counter, since disconnection can be called also
   * many times as well as usb_audio_probe().
   */
 -static void snd_usb_audio_disconnect(struct usb_device *dev,
 -                                   struct snd_usb_audio *chip)
 +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;
        up_write(&chip->shutdown_rwsem);
  
        mutex_lock(&register_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;
  
                snd_card_disconnect(card);
                /* release the pcm resources */
                        snd_usbmidi_disconnect(p);
                }
                /* release mixer resources */
 -              list_for_each(p, &chip->mixer_list) {
 -                      snd_usb_mixer_disconnect(p);
 +              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(&register_mutex);
                snd_card_free_when_closed(card);