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/oxfw/oxfw.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'sound/firewire/oxfw') diff --git a/sound/firewire/oxfw/oxfw.c b/sound/firewire/oxfw/oxfw.c index 36f905b371e6..14fe02a9ed5d 100644 --- a/sound/firewire/oxfw/oxfw.c +++ b/sound/firewire/oxfw/oxfw.c @@ -118,9 +118,6 @@ static void oxfw_free(struct snd_oxfw *oxfw) snd_oxfw_stream_destroy_simplex(oxfw, &oxfw->rx_stream); if (oxfw->has_output) snd_oxfw_stream_destroy_simplex(oxfw, &oxfw->tx_stream); - - mutex_destroy(&oxfw->mutex); - fw_unit_put(oxfw->unit); } /* @@ -329,10 +326,10 @@ static void oxfw_remove(struct fw_unit *unit) if (oxfw->registered) { // Block till all of ALSA character devices are released. snd_card_free(oxfw->card); - } else { - /* Don't forget this case. */ - oxfw_free(oxfw); } + + mutex_destroy(&oxfw->mutex); + fw_unit_put(oxfw->unit); } static const struct compat_info griffin_firewave = { -- cgit v1.2.3