Commit 61ccc6f6 authored by Takashi Sakamoto's avatar Takashi Sakamoto Committed by Takashi Iwai

ALSA: firewire: block .remove callback of bus driver till all of ALSA...

ALSA: firewire: block .remove callback of bus driver till all of ALSA character devices are released

At present, in .remove callback of bus driver just decrease reference
count of device for ALSA card instance. This delegates release of the
device to a process in which the last of ALSA character device is
released.

On the other hand, the other drivers such as for devices on PCIe are
programmed to block .remove callback of bus driver till all of ALSA
character devices are released.

For consistency of behaviour for whole drivers, this probably confuses
users. This commit takes drivers in ALSA firewire stack to imitate the
above behaviour.
Signed-off-by: default avatarTakashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent d06fb562
...@@ -374,8 +374,8 @@ static void bebob_remove(struct fw_unit *unit) ...@@ -374,8 +374,8 @@ static void bebob_remove(struct fw_unit *unit)
cancel_delayed_work_sync(&bebob->dwork); cancel_delayed_work_sync(&bebob->dwork);
if (bebob->registered) { if (bebob->registered) {
/* No need to wait for releasing card object in this context. */ // Block till all of ALSA character devices are released.
snd_card_free_when_closed(bebob->card); snd_card_free(bebob->card);
} else { } else {
/* Don't forget this case. */ /* Don't forget this case. */
bebob_free(bebob); bebob_free(bebob);
......
...@@ -172,8 +172,8 @@ static void snd_dg00x_remove(struct fw_unit *unit) ...@@ -172,8 +172,8 @@ static void snd_dg00x_remove(struct fw_unit *unit)
cancel_delayed_work_sync(&dg00x->dwork); cancel_delayed_work_sync(&dg00x->dwork);
if (dg00x->registered) { if (dg00x->registered) {
/* No need to wait for releasing card object in this context. */ // Block till all of ALSA character devices are released.
snd_card_free_when_closed(dg00x->card); snd_card_free(dg00x->card);
} else { } else {
/* Don't forget this case. */ /* Don't forget this case. */
dg00x_free(dg00x); dg00x_free(dg00x);
......
...@@ -145,8 +145,8 @@ static void snd_ff_remove(struct fw_unit *unit) ...@@ -145,8 +145,8 @@ static void snd_ff_remove(struct fw_unit *unit)
cancel_work_sync(&ff->dwork.work); cancel_work_sync(&ff->dwork.work);
if (ff->registered) { if (ff->registered) {
/* No need to wait for releasing card object in this context. */ // Block till all of ALSA character devices are released.
snd_card_free_when_closed(ff->card); snd_card_free(ff->card);
} else { } else {
/* Don't forget this case. */ /* Don't forget this case. */
ff_free(ff); ff_free(ff);
......
...@@ -358,8 +358,8 @@ static void efw_remove(struct fw_unit *unit) ...@@ -358,8 +358,8 @@ static void efw_remove(struct fw_unit *unit)
cancel_delayed_work_sync(&efw->dwork); cancel_delayed_work_sync(&efw->dwork);
if (efw->registered) { if (efw->registered) {
/* No need to wait for releasing card object in this context. */ // Block till all of ALSA character devices are released.
snd_card_free_when_closed(efw->card); snd_card_free(efw->card);
} else { } else {
/* Don't forget this case. */ /* Don't forget this case. */
efw_free(efw); efw_free(efw);
......
...@@ -703,7 +703,8 @@ static void isight_remove(struct fw_unit *unit) ...@@ -703,7 +703,8 @@ static void isight_remove(struct fw_unit *unit)
isight_stop_streaming(isight); isight_stop_streaming(isight);
mutex_unlock(&isight->mutex); mutex_unlock(&isight->mutex);
snd_card_free_when_closed(isight->card); // Block till all of ALSA character devices are released.
snd_card_free(isight->card);
} }
static const struct ieee1394_device_id isight_id_table[] = { static const struct ieee1394_device_id isight_id_table[] = {
......
...@@ -172,8 +172,8 @@ static void motu_remove(struct fw_unit *unit) ...@@ -172,8 +172,8 @@ static void motu_remove(struct fw_unit *unit)
cancel_delayed_work_sync(&motu->dwork); cancel_delayed_work_sync(&motu->dwork);
if (motu->registered) { if (motu->registered) {
/* No need to wait for releasing card object in this context. */ // Block till all of ALSA character devices are released.
snd_card_free_when_closed(motu->card); snd_card_free(motu->card);
} else { } else {
/* Don't forget this case. */ /* Don't forget this case. */
motu_free(motu); motu_free(motu);
......
...@@ -327,8 +327,8 @@ static void oxfw_remove(struct fw_unit *unit) ...@@ -327,8 +327,8 @@ static void oxfw_remove(struct fw_unit *unit)
cancel_delayed_work_sync(&oxfw->dwork); cancel_delayed_work_sync(&oxfw->dwork);
if (oxfw->registered) { if (oxfw->registered) {
/* No need to wait for releasing card object in this context. */ // Block till all of ALSA character devices are released.
snd_card_free_when_closed(oxfw->card); snd_card_free(oxfw->card);
} else { } else {
/* Don't forget this case. */ /* Don't forget this case. */
oxfw_free(oxfw); oxfw_free(oxfw);
......
...@@ -212,8 +212,8 @@ static void snd_tscm_remove(struct fw_unit *unit) ...@@ -212,8 +212,8 @@ static void snd_tscm_remove(struct fw_unit *unit)
cancel_delayed_work_sync(&tscm->dwork); cancel_delayed_work_sync(&tscm->dwork);
if (tscm->registered) { if (tscm->registered) {
/* No need to wait for releasing card object in this context. */ // Block till all of ALSA character devices are released.
snd_card_free_when_closed(tscm->card); snd_card_free(tscm->card);
} else { } else {
/* Don't forget this case. */ /* Don't forget this case. */
tscm_free(tscm); tscm_free(tscm);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment