aboutsummaryrefslogtreecommitdiffstats
path: root/sound/drivers/opl3/opl3_seq.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/drivers/opl3/opl3_seq.c')
-rw-r--r--sound/drivers/opl3/opl3_seq.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/sound/drivers/opl3/opl3_seq.c b/sound/drivers/opl3/opl3_seq.c
index ff6da16b9178..6fd60b7e5805 100644
--- a/sound/drivers/opl3/opl3_seq.c
+++ b/sound/drivers/opl3/opl3_seq.c
@@ -51,14 +51,15 @@ void snd_opl3_synth_use_dec(struct snd_opl3 * opl3)
51int snd_opl3_synth_setup(struct snd_opl3 * opl3) 51int snd_opl3_synth_setup(struct snd_opl3 * opl3)
52{ 52{
53 int idx; 53 int idx;
54 struct snd_hwdep *hwdep = opl3->hwdep;
54 55
55 mutex_lock(&opl3->access_mutex); 56 mutex_lock(&hwdep->open_mutex);
56 if (opl3->used) { 57 if (hwdep->used) {
57 mutex_unlock(&opl3->access_mutex); 58 mutex_unlock(&hwdep->open_mutex);
58 return -EBUSY; 59 return -EBUSY;
59 } 60 }
60 opl3->used++; 61 hwdep->used++;
61 mutex_unlock(&opl3->access_mutex); 62 mutex_unlock(&hwdep->open_mutex);
62 63
63 snd_opl3_reset(opl3); 64 snd_opl3_reset(opl3);
64 65
@@ -91,9 +92,11 @@ void snd_opl3_synth_cleanup(struct snd_opl3 * opl3)
91 spin_unlock_irqrestore(&opl3->sys_timer_lock, flags); 92 spin_unlock_irqrestore(&opl3->sys_timer_lock, flags);
92 93
93 snd_opl3_reset(opl3); 94 snd_opl3_reset(opl3);
94 mutex_lock(&opl3->access_mutex); 95 hwdep = opl3->hwdep;
95 opl3->used--; 96 mutex_lock(&hwdep->open_mutex);
96 mutex_unlock(&opl3->access_mutex); 97 hwdep->used--;
98 mutex_unlock(&hwdep->open_mutex);
99 wake_up(&hwdep->open_wait);
97} 100}
98 101
99static int snd_opl3_synth_use(void *private_data, struct snd_seq_port_subscribe * info) 102static int snd_opl3_synth_use(void *private_data, struct snd_seq_port_subscribe * info)