summaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorTakashi Sakamoto <o-takashi@sakamocchi.jp>2018-10-10 02:34:59 -0400
committerTakashi Iwai <tiwai@suse.de>2018-10-10 06:11:34 -0400
commit61ccc6f6b27c03bb32ca38a3c580d49ce1612d43 (patch)
tree7db489b32d390c7627693eec90e3488d7c3a21ec /sound
parentd06fb562bff5d14defdacbd92449bacbaedd5cdf (diff)
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: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound')
-rw-r--r--sound/firewire/bebob/bebob.c4
-rw-r--r--sound/firewire/digi00x/digi00x.c4
-rw-r--r--sound/firewire/fireface/ff.c4
-rw-r--r--sound/firewire/fireworks/fireworks.c4
-rw-r--r--sound/firewire/isight.c3
-rw-r--r--sound/firewire/motu/motu.c4
-rw-r--r--sound/firewire/oxfw/oxfw.c4
-rw-r--r--sound/firewire/tascam/tascam.c4
8 files changed, 16 insertions, 15 deletions
diff --git a/sound/firewire/bebob/bebob.c b/sound/firewire/bebob/bebob.c
index 72b04214a3b5..3a5579cb3aa8 100644
--- a/sound/firewire/bebob/bebob.c
+++ b/sound/firewire/bebob/bebob.c
@@ -374,8 +374,8 @@ static void bebob_remove(struct fw_unit *unit)
374 cancel_delayed_work_sync(&bebob->dwork); 374 cancel_delayed_work_sync(&bebob->dwork);
375 375
376 if (bebob->registered) { 376 if (bebob->registered) {
377 /* No need to wait for releasing card object in this context. */ 377 // Block till all of ALSA character devices are released.
378 snd_card_free_when_closed(bebob->card); 378 snd_card_free(bebob->card);
379 } else { 379 } else {
380 /* Don't forget this case. */ 380 /* Don't forget this case. */
381 bebob_free(bebob); 381 bebob_free(bebob);
diff --git a/sound/firewire/digi00x/digi00x.c b/sound/firewire/digi00x/digi00x.c
index 654420f1c9bd..554d7ff737a2 100644
--- a/sound/firewire/digi00x/digi00x.c
+++ b/sound/firewire/digi00x/digi00x.c
@@ -172,8 +172,8 @@ static void snd_dg00x_remove(struct fw_unit *unit)
172 cancel_delayed_work_sync(&dg00x->dwork); 172 cancel_delayed_work_sync(&dg00x->dwork);
173 173
174 if (dg00x->registered) { 174 if (dg00x->registered) {
175 /* No need to wait for releasing card object in this context. */ 175 // Block till all of ALSA character devices are released.
176 snd_card_free_when_closed(dg00x->card); 176 snd_card_free(dg00x->card);
177 } else { 177 } else {
178 /* Don't forget this case. */ 178 /* Don't forget this case. */
179 dg00x_free(dg00x); 179 dg00x_free(dg00x);
diff --git a/sound/firewire/fireface/ff.c b/sound/firewire/fireface/ff.c
index 98731bd8816f..73425dfe63bf 100644
--- a/sound/firewire/fireface/ff.c
+++ b/sound/firewire/fireface/ff.c
@@ -145,8 +145,8 @@ static void snd_ff_remove(struct fw_unit *unit)
145 cancel_work_sync(&ff->dwork.work); 145 cancel_work_sync(&ff->dwork.work);
146 146
147 if (ff->registered) { 147 if (ff->registered) {
148 /* No need to wait for releasing card object in this context. */ 148 // Block till all of ALSA character devices are released.
149 snd_card_free_when_closed(ff->card); 149 snd_card_free(ff->card);
150 } else { 150 } else {
151 /* Don't forget this case. */ 151 /* Don't forget this case. */
152 ff_free(ff); 152 ff_free(ff);
diff --git a/sound/firewire/fireworks/fireworks.c b/sound/firewire/fireworks/fireworks.c
index f680e2f27806..5a17ead86e61 100644
--- a/sound/firewire/fireworks/fireworks.c
+++ b/sound/firewire/fireworks/fireworks.c
@@ -358,8 +358,8 @@ static void efw_remove(struct fw_unit *unit)
358 cancel_delayed_work_sync(&efw->dwork); 358 cancel_delayed_work_sync(&efw->dwork);
359 359
360 if (efw->registered) { 360 if (efw->registered) {
361 /* No need to wait for releasing card object in this context. */ 361 // Block till all of ALSA character devices are released.
362 snd_card_free_when_closed(efw->card); 362 snd_card_free(efw->card);
363 } else { 363 } else {
364 /* Don't forget this case. */ 364 /* Don't forget this case. */
365 efw_free(efw); 365 efw_free(efw);
diff --git a/sound/firewire/isight.c b/sound/firewire/isight.c
index 30957477e005..1f591c8805ea 100644
--- a/sound/firewire/isight.c
+++ b/sound/firewire/isight.c
@@ -703,7 +703,8 @@ static void isight_remove(struct fw_unit *unit)
703 isight_stop_streaming(isight); 703 isight_stop_streaming(isight);
704 mutex_unlock(&isight->mutex); 704 mutex_unlock(&isight->mutex);
705 705
706 snd_card_free_when_closed(isight->card); 706 // Block till all of ALSA character devices are released.
707 snd_card_free(isight->card);
707} 708}
708 709
709static const struct ieee1394_device_id isight_id_table[] = { 710static const struct ieee1394_device_id isight_id_table[] = {
diff --git a/sound/firewire/motu/motu.c b/sound/firewire/motu/motu.c
index fd5726424c7a..12680c85b37f 100644
--- a/sound/firewire/motu/motu.c
+++ b/sound/firewire/motu/motu.c
@@ -172,8 +172,8 @@ static void motu_remove(struct fw_unit *unit)
172 cancel_delayed_work_sync(&motu->dwork); 172 cancel_delayed_work_sync(&motu->dwork);
173 173
174 if (motu->registered) { 174 if (motu->registered) {
175 /* No need to wait for releasing card object in this context. */ 175 // Block till all of ALSA character devices are released.
176 snd_card_free_when_closed(motu->card); 176 snd_card_free(motu->card);
177 } else { 177 } else {
178 /* Don't forget this case. */ 178 /* Don't forget this case. */
179 motu_free(motu); 179 motu_free(motu);
diff --git a/sound/firewire/oxfw/oxfw.c b/sound/firewire/oxfw/oxfw.c
index 6ac551786b93..36f905b371e6 100644
--- a/sound/firewire/oxfw/oxfw.c
+++ b/sound/firewire/oxfw/oxfw.c
@@ -327,8 +327,8 @@ static void oxfw_remove(struct fw_unit *unit)
327 cancel_delayed_work_sync(&oxfw->dwork); 327 cancel_delayed_work_sync(&oxfw->dwork);
328 328
329 if (oxfw->registered) { 329 if (oxfw->registered) {
330 /* No need to wait for releasing card object in this context. */ 330 // Block till all of ALSA character devices are released.
331 snd_card_free_when_closed(oxfw->card); 331 snd_card_free(oxfw->card);
332 } else { 332 } else {
333 /* Don't forget this case. */ 333 /* Don't forget this case. */
334 oxfw_free(oxfw); 334 oxfw_free(oxfw);
diff --git a/sound/firewire/tascam/tascam.c b/sound/firewire/tascam/tascam.c
index 53f20153ba71..6f7aaa8c84aa 100644
--- a/sound/firewire/tascam/tascam.c
+++ b/sound/firewire/tascam/tascam.c
@@ -212,8 +212,8 @@ static void snd_tscm_remove(struct fw_unit *unit)
212 cancel_delayed_work_sync(&tscm->dwork); 212 cancel_delayed_work_sync(&tscm->dwork);
213 213
214 if (tscm->registered) { 214 if (tscm->registered) {
215 /* No need to wait for releasing card object in this context. */ 215 // Block till all of ALSA character devices are released.
216 snd_card_free_when_closed(tscm->card); 216 snd_card_free(tscm->card);
217 } else { 217 } else {
218 /* Don't forget this case. */ 218 /* Don't forget this case. */
219 tscm_free(tscm); 219 tscm_free(tscm);