From 5b14ec25a79bf60fc9a663fe579a500b6ac9d8ab Mon Sep 17 00:00:00 2001 From: Takashi Sakamoto Date: Wed, 10 Oct 2018 15:35:00 +0900 Subject: 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 Signed-off-by: Takashi Iwai --- sound/firewire/dice/dice.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'sound/firewire/dice') 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) -- cgit