diff options
author | Takashi Sakamoto <o-takashi@sakamocchi.jp> | 2018-10-10 08:35:00 +0200 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2018-10-10 12:11:41 +0200 |
commit | 5b14ec25a79bf60fc9a663fe579a500b6ac9d8ab (patch) | |
tree | 011033efd4ac1674da01c16ef438092f32a48243 /sound/firewire/digi00x | |
parent | ALSA: firewire: block .remove callback of bus driver till all of ALSA charact... (diff) | |
download | linux-5b14ec25a79bf60fc9a663fe579a500b6ac9d8ab.tar.xz linux-5b14ec25a79bf60fc9a663fe579a500b6ac9d8ab.zip |
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/digi00x')
-rw-r--r-- | sound/firewire/digi00x/digi00x.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/sound/firewire/digi00x/digi00x.c b/sound/firewire/digi00x/digi00x.c index 554d7ff737a2..7a24348968b9 100644 --- a/sound/firewire/digi00x/digi00x.c +++ b/sound/firewire/digi00x/digi00x.c @@ -45,9 +45,6 @@ static void dg00x_free(struct snd_dg00x *dg00x) { snd_dg00x_stream_destroy_duplex(dg00x); snd_dg00x_transaction_unregister(dg00x); - - mutex_destroy(&dg00x->mutex); - fw_unit_put(dg00x->unit); } static void dg00x_card_free(struct snd_card *card) @@ -174,10 +171,10 @@ static void snd_dg00x_remove(struct fw_unit *unit) if (dg00x->registered) { // Block till all of ALSA character devices are released. snd_card_free(dg00x->card); - } else { - /* Don't forget this case. */ - dg00x_free(dg00x); } + + mutex_destroy(&dg00x->mutex); + fw_unit_put(dg00x->unit); } static const struct ieee1394_device_id snd_dg00x_id_table[] = { |