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/oxfw | |
parent | 61ccc6f6b27c03bb32ca38a3c580d49ce1612d43 (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/oxfw')
-rw-r--r-- | sound/firewire/oxfw/oxfw.c | 9 |
1 files changed, 3 insertions, 6 deletions
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 = { |