summaryrefslogtreecommitdiffstats
path: root/sound/firewire/motu
diff options
context:
space:
mode:
authorTakashi Sakamoto <o-takashi@sakamocchi.jp>2018-10-10 02:35:00 -0400
committerTakashi Iwai <tiwai@suse.de>2018-10-10 06:11:41 -0400
commit5b14ec25a79bf60fc9a663fe579a500b6ac9d8ab (patch)
tree011033efd4ac1674da01c16ef438092f32a48243 /sound/firewire/motu
parent61ccc6f6b27c03bb32ca38a3c580d49ce1612d43 (diff)
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/motu')
-rw-r--r--sound/firewire/motu/motu.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/sound/firewire/motu/motu.c b/sound/firewire/motu/motu.c
index 12680c85b37f..281028ee3273 100644
--- a/sound/firewire/motu/motu.c
+++ b/sound/firewire/motu/motu.c
@@ -57,9 +57,6 @@ static void motu_free(struct snd_motu *motu)
57 snd_motu_transaction_unregister(motu); 57 snd_motu_transaction_unregister(motu);
58 58
59 snd_motu_stream_destroy_duplex(motu); 59 snd_motu_stream_destroy_duplex(motu);
60
61 mutex_destroy(&motu->mutex);
62 fw_unit_put(motu->unit);
63} 60}
64 61
65/* 62/*
@@ -174,10 +171,10 @@ static void motu_remove(struct fw_unit *unit)
174 if (motu->registered) { 171 if (motu->registered) {
175 // Block till all of ALSA character devices are released. 172 // Block till all of ALSA character devices are released.
176 snd_card_free(motu->card); 173 snd_card_free(motu->card);
177 } else {
178 /* Don't forget this case. */
179 motu_free(motu);
180 } 174 }
175
176 mutex_destroy(&motu->mutex);
177 fw_unit_put(motu->unit);
181} 178}
182 179
183static void motu_bus_update(struct fw_unit *unit) 180static void motu_bus_update(struct fw_unit *unit)