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/isight.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'sound/firewire/isight.c') diff --git a/sound/firewire/isight.c b/sound/firewire/isight.c index 1f591c8805ea..de4decfb74d5 100644 --- a/sound/firewire/isight.c +++ b/sound/firewire/isight.c @@ -602,8 +602,6 @@ static void isight_card_free(struct snd_card *card) struct isight *isight = card->private_data; fw_iso_resources_destroy(&isight->resources); - fw_unit_put(isight->unit); - mutex_destroy(&isight->mutex); } static u64 get_unit_base(struct fw_unit *unit) @@ -705,6 +703,9 @@ static void isight_remove(struct fw_unit *unit) // Block till all of ALSA character devices are released. snd_card_free(isight->card); + + mutex_destroy(&isight->mutex); + fw_unit_put(isight->unit); } static const struct ieee1394_device_id isight_id_table[] = { -- cgit