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/bebob/bebob.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'sound/firewire/bebob') diff --git a/sound/firewire/bebob/bebob.c b/sound/firewire/bebob/bebob.c index 3a5579cb3aa8..34ed8afbb30c 100644 --- a/sound/firewire/bebob/bebob.c +++ b/sound/firewire/bebob/bebob.c @@ -129,9 +129,6 @@ end: static void bebob_free(struct snd_bebob *bebob) { snd_bebob_stream_destroy_duplex(bebob); - - mutex_destroy(&bebob->mutex); - fw_unit_put(bebob->unit); } /* @@ -376,10 +373,10 @@ static void bebob_remove(struct fw_unit *unit) if (bebob->registered) { // Block till all of ALSA character devices are released. snd_card_free(bebob->card); - } else { - /* Don't forget this case. */ - bebob_free(bebob); } + + mutex_destroy(&bebob->mutex); + fw_unit_put(bebob->unit); } static const struct snd_bebob_rate_spec normal_rate_spec = { -- cgit v1.2.3