summaryrefslogtreecommitdiffstats
path: root/sound/firewire/fireworks
diff options
context:
space:
mode:
Diffstat (limited to 'sound/firewire/fireworks')
-rw-r--r--sound/firewire/fireworks/fireworks.c28
1 files changed, 7 insertions, 21 deletions
diff --git a/sound/firewire/fireworks/fireworks.c b/sound/firewire/fireworks/fireworks.c
index da0c31033821..faf0e001c4c5 100644
--- a/sound/firewire/fireworks/fireworks.c
+++ b/sound/firewire/fireworks/fireworks.c
@@ -184,8 +184,11 @@ end:
return err;
}
-static void efw_free(struct snd_efw *efw)
+static void
+efw_card_free(struct snd_card *card)
{
+ struct snd_efw *efw = card->private_data;
+
mutex_lock(&devices_mutex);
clear_bit(efw->card_index, devices_used);
mutex_unlock(&devices_mutex);
@@ -194,18 +197,6 @@ static void efw_free(struct snd_efw *efw)
snd_efw_transaction_remove_instance(efw);
}
-/*
- * This module releases the FireWire unit data after all ALSA character devices
- * are released by applications. This is for releasing stream data or finishing
- * transactions safely. Thus at returning from .remove(), this module still keep
- * references for the unit.
- */
-static void
-efw_card_free(struct snd_card *card)
-{
- efw_free(card->private_data);
-}
-
static void
do_registration(struct work_struct *work)
{
@@ -236,6 +227,9 @@ do_registration(struct work_struct *work)
set_bit(card_index, devices_used);
mutex_unlock(&devices_mutex);
+ efw->card->private_free = efw_card_free;
+ efw->card->private_data = efw;
+
/* prepare response buffer */
snd_efw_resp_buf_size = clamp(snd_efw_resp_buf_size,
SND_EFW_RESPONSE_MAXIMUM_BYTES, 4096U);
@@ -276,18 +270,10 @@ do_registration(struct work_struct *work)
if (err < 0)
goto error;
- /*
- * After registered, efw instance can be released corresponding to
- * releasing the sound card instance.
- */
- efw->card->private_free = efw_card_free;
- efw->card->private_data = efw;
efw->registered = true;
return;
error:
- snd_efw_transaction_remove_instance(efw);
- snd_efw_stream_destroy_duplex(efw);
snd_card_free(efw->card);
dev_info(&efw->unit->device,
"Sound card registration failed: %d\n", err);