- patches.suse/slab-handle-memoryless-nodes-v2a.patch: Refresh.
[linux-flexiantxendom0-3.2.10.git] / drivers / usb / gadget / u_audio.c
index 8252595..35e0930 100644 (file)
@@ -288,6 +288,7 @@ static int gaudio_close_snd_dev(struct gaudio *gau)
        return 0;
 }
 
+static struct gaudio *the_card;
 /**
  * gaudio_setup - setup ALSA interface and preparing for USB transfer
  *
@@ -303,6 +304,9 @@ int __init gaudio_setup(struct gaudio *card)
        if (ret)
                ERROR(card, "we need at least one control device\n");
 
+       if (!the_card)
+               the_card = card;
+
        return ret;
 
 }
@@ -312,9 +316,11 @@ int __init gaudio_setup(struct gaudio *card)
  *
  * This is called to free all resources allocated by @gaudio_setup().
  */
-void gaudio_cleanup(struct gaudio *card)
+void gaudio_cleanup(void)
 {
-       if (card)
-               gaudio_close_snd_dev(card);
+       if (the_card) {
+               gaudio_close_snd_dev(the_card);
+               the_card = NULL;
+       }
 }