diff options
author | Takashi Iwai <tiwai@suse.de> | 2007-10-30 06:59:15 -0400 |
---|---|---|
committer | Jaroslav Kysela <perex@perex.cz> | 2008-01-31 11:29:13 -0500 |
commit | 05c1afe75fcebf456017ec186811cf1599f4360e (patch) | |
tree | 3000085048bb79d54f61c993c2b8e5eb1bd0618f /sound/drivers/opl3/opl3_synth.c | |
parent | 224a033252bba46c5c8b5df625f5e781ca138f48 (diff) |
[ALSA] opl3 - simplify exclusive access lock
Use the exclusive access lock in hwdep instead of the own one.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Diffstat (limited to 'sound/drivers/opl3/opl3_synth.c')
-rw-r--r-- | sound/drivers/opl3/opl3_synth.c | 14 |
1 files changed, 0 insertions, 14 deletions
diff --git a/sound/drivers/opl3/opl3_synth.c b/sound/drivers/opl3/opl3_synth.c index d55eefce44c1..a7bf7a4b1f85 100644 --- a/sound/drivers/opl3/opl3_synth.c +++ b/sound/drivers/opl3/opl3_synth.c | |||
@@ -76,16 +76,6 @@ static int snd_opl3_set_connection(struct snd_opl3 * opl3, int connection); | |||
76 | */ | 76 | */ |
77 | int snd_opl3_open(struct snd_hwdep * hw, struct file *file) | 77 | int snd_opl3_open(struct snd_hwdep * hw, struct file *file) |
78 | { | 78 | { |
79 | struct snd_opl3 *opl3 = hw->private_data; | ||
80 | |||
81 | mutex_lock(&opl3->access_mutex); | ||
82 | if (opl3->used) { | ||
83 | mutex_unlock(&opl3->access_mutex); | ||
84 | return -EAGAIN; | ||
85 | } | ||
86 | opl3->used++; | ||
87 | mutex_unlock(&opl3->access_mutex); | ||
88 | |||
89 | return 0; | 79 | return 0; |
90 | } | 80 | } |
91 | 81 | ||
@@ -185,10 +175,6 @@ int snd_opl3_release(struct snd_hwdep * hw, struct file *file) | |||
185 | struct snd_opl3 *opl3 = hw->private_data; | 175 | struct snd_opl3 *opl3 = hw->private_data; |
186 | 176 | ||
187 | snd_opl3_reset(opl3); | 177 | snd_opl3_reset(opl3); |
188 | mutex_lock(&opl3->access_mutex); | ||
189 | opl3->used--; | ||
190 | mutex_unlock(&opl3->access_mutex); | ||
191 | |||
192 | return 0; | 178 | return 0; |
193 | } | 179 | } |
194 | 180 | ||