diff options
Diffstat (limited to 'sound/firewire/oxfw/oxfw-midi.c')
-rw-r--r-- | sound/firewire/oxfw/oxfw-midi.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/sound/firewire/oxfw/oxfw-midi.c b/sound/firewire/oxfw/oxfw-midi.c index 334b11d1a422..540a30338516 100644 --- a/sound/firewire/oxfw/oxfw-midi.c +++ b/sound/firewire/oxfw/oxfw-midi.c | |||
@@ -13,6 +13,10 @@ static int midi_capture_open(struct snd_rawmidi_substream *substream) | |||
13 | struct snd_oxfw *oxfw = substream->rmidi->private_data; | 13 | struct snd_oxfw *oxfw = substream->rmidi->private_data; |
14 | int err; | 14 | int err; |
15 | 15 | ||
16 | err = snd_oxfw_stream_lock_try(oxfw); | ||
17 | if (err < 0) | ||
18 | return err; | ||
19 | |||
16 | mutex_lock(&oxfw->mutex); | 20 | mutex_lock(&oxfw->mutex); |
17 | 21 | ||
18 | oxfw->capture_substreams++; | 22 | oxfw->capture_substreams++; |
@@ -20,6 +24,9 @@ static int midi_capture_open(struct snd_rawmidi_substream *substream) | |||
20 | 24 | ||
21 | mutex_unlock(&oxfw->mutex); | 25 | mutex_unlock(&oxfw->mutex); |
22 | 26 | ||
27 | if (err < 0) | ||
28 | snd_oxfw_stream_lock_release(oxfw); | ||
29 | |||
23 | return err; | 30 | return err; |
24 | } | 31 | } |
25 | 32 | ||
@@ -28,6 +35,10 @@ static int midi_playback_open(struct snd_rawmidi_substream *substream) | |||
28 | struct snd_oxfw *oxfw = substream->rmidi->private_data; | 35 | struct snd_oxfw *oxfw = substream->rmidi->private_data; |
29 | int err; | 36 | int err; |
30 | 37 | ||
38 | err = snd_oxfw_stream_lock_try(oxfw); | ||
39 | if (err < 0) | ||
40 | return err; | ||
41 | |||
31 | mutex_lock(&oxfw->mutex); | 42 | mutex_lock(&oxfw->mutex); |
32 | 43 | ||
33 | oxfw->playback_substreams++; | 44 | oxfw->playback_substreams++; |
@@ -35,6 +46,9 @@ static int midi_playback_open(struct snd_rawmidi_substream *substream) | |||
35 | 46 | ||
36 | mutex_unlock(&oxfw->mutex); | 47 | mutex_unlock(&oxfw->mutex); |
37 | 48 | ||
49 | if (err < 0) | ||
50 | snd_oxfw_stream_lock_release(oxfw); | ||
51 | |||
38 | return err; | 52 | return err; |
39 | } | 53 | } |
40 | 54 | ||
@@ -49,6 +63,7 @@ static int midi_capture_close(struct snd_rawmidi_substream *substream) | |||
49 | 63 | ||
50 | mutex_unlock(&oxfw->mutex); | 64 | mutex_unlock(&oxfw->mutex); |
51 | 65 | ||
66 | snd_oxfw_stream_lock_release(oxfw); | ||
52 | return 0; | 67 | return 0; |
53 | } | 68 | } |
54 | 69 | ||
@@ -63,6 +78,7 @@ static int midi_playback_close(struct snd_rawmidi_substream *substream) | |||
63 | 78 | ||
64 | mutex_unlock(&oxfw->mutex); | 79 | mutex_unlock(&oxfw->mutex); |
65 | 80 | ||
81 | snd_oxfw_stream_lock_release(oxfw); | ||
66 | return 0; | 82 | return 0; |
67 | } | 83 | } |
68 | 84 | ||