diff options
author | Takashi Sakamoto <o-takashi@sakamocchi.jp> | 2018-10-10 15:35:00 +0900 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2018-10-10 12:11:41 +0200 |
commit | 5b14ec25a79bf60fc9a663fe579a500b6ac9d8ab (patch) | |
tree | 011033efd4ac1674da01c16ef438092f32a48243 /sound/firewire/dice | |
parent | 61ccc6f6b27c03bb32ca38a3c580d49ce1612d43 (diff) | |
download | linux-5b14ec25a79bf60fc9a663fe579a500b6ac9d8ab.tar.bz2 |
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/dice')
-rw-r--r-- | sound/firewire/dice/dice.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/sound/firewire/dice/dice.c b/sound/firewire/dice/dice.c index 9bf77adb3127..c6b63e3f36a8 100644 --- a/sound/firewire/dice/dice.c +++ b/sound/firewire/dice/dice.c @@ -126,9 +126,6 @@ static void dice_free(struct snd_dice *dice) { snd_dice_stream_destroy_duplex(dice); snd_dice_transaction_destroy(dice); - - mutex_destroy(&dice->mutex); - fw_unit_put(dice->unit); } /* @@ -261,10 +258,10 @@ static void dice_remove(struct fw_unit *unit) if (dice->registered) { /* No need to wait for releasing card object in this context. */ snd_card_free_when_closed(dice->card); - } else { - /* Don't forget this case. */ - dice_free(dice); } + + mutex_destroy(&dice->mutex); + fw_unit_put(dice->unit); } static void dice_bus_reset(struct fw_unit *unit) |