summaryrefslogtreecommitdiff
path: root/sound/firewire/tascam/tascam.c
diff options
context:
space:
mode:
authorTakashi Sakamoto <o-takashi@sakamocchi.jp>2018-10-10 09:35:00 +0300
committerTakashi Iwai <tiwai@suse.de>2018-10-10 13:11:41 +0300
commit5b14ec25a79bf60fc9a663fe579a500b6ac9d8ab (patch)
tree011033efd4ac1674da01c16ef438092f32a48243 /sound/firewire/tascam/tascam.c
parent61ccc6f6b27c03bb32ca38a3c580d49ce1612d43 (diff)
downloadlinux-5b14ec25a79bf60fc9a663fe579a500b6ac9d8ab.tar.xz
ALSA: firewire: release reference count of firewire unit in .remove callback of bus driver
In a previous commit, drivers in ALSA firewire stack blocks .remove callback of bus driver. This enables to release members of private data in the callback after releasing device of sound card. This commit simplifies codes to release the members. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/firewire/tascam/tascam.c')
-rw-r--r--sound/firewire/tascam/tascam.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/sound/firewire/tascam/tascam.c b/sound/firewire/tascam/tascam.c
index 6f7aaa8c84aa..f4f959128341 100644
--- a/sound/firewire/tascam/tascam.c
+++ b/sound/firewire/tascam/tascam.c
@@ -89,9 +89,6 @@ static void tscm_free(struct snd_tscm *tscm)
{
snd_tscm_transaction_unregister(tscm);
snd_tscm_stream_destroy_duplex(tscm);
-
- mutex_destroy(&tscm->mutex);
- fw_unit_put(tscm->unit);
}
static void tscm_card_free(struct snd_card *card)
@@ -214,10 +211,10 @@ static void snd_tscm_remove(struct fw_unit *unit)
if (tscm->registered) {
// Block till all of ALSA character devices are released.
snd_card_free(tscm->card);
- } else {
- /* Don't forget this case. */
- tscm_free(tscm);
}
+
+ mutex_destroy(&tscm->mutex);
+ fw_unit_put(tscm->unit);
}
static const struct ieee1394_device_id snd_tscm_id_table[] = {