ALSA: fireworks/bebob/dice/oxfw: make it possible to shutdown safely
[deliverable/linux.git] / sound / firewire / bebob / bebob.c
index b612599fb543ead4c8ed6ed25ed83c4d97c3b30f..611b7dae7ee54c932394c713022fd4501c84f7ca 100644 (file)
@@ -127,8 +127,11 @@ bebob_card_free(struct snd_card *card)
 {
        struct snd_bebob *bebob = card->private_data;
 
+       snd_bebob_stream_destroy_duplex(bebob);
        fw_unit_put(bebob->unit);
 
+       kfree(bebob->maudio_special_quirk);
+
        if (bebob->card_index >= 0) {
                mutex_lock(&devices_mutex);
                clear_bit(bebob->card_index, devices_used);
@@ -314,10 +317,9 @@ static void bebob_remove(struct fw_unit *unit)
        if (bebob == NULL)
                return;
 
-       kfree(bebob->maudio_special_quirk);
-
-       snd_bebob_stream_destroy_duplex(bebob);
-       snd_card_disconnect(bebob->card);
+       /* Awake bus-reset waiters. */
+       if (!completion_done(&bebob->bus_reset))
+               complete_all(&bebob->bus_reset);
 
        /* No need to wait for releasing card object in this context. */
        snd_card_free_when_closed(bebob->card);
This page took 0.023568 seconds and 5 git commands to generate.