diff options
author | Takashi Iwai <tiwai@suse.de> | 2015-01-23 08:49:22 -0500 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2015-01-28 01:21:00 -0500 |
commit | f2a76225b962f00642002fb109aee2e5b0dc4259 (patch) | |
tree | 1e9da1e3e9162d8e62b5af0638e5bc13014849d8 /sound/usb | |
parent | 5343ecf4e5c94aecdd6a859b76c125c3544865d1 (diff) |
ALSA: line6: Drop superfluous spinlock for trigger
The trigger callback is already spinlocked, so we need no more lock
here (even for the linked substreams). Let's drop it.
Tested-by: Chris Rorvick <chris@rorvick.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/usb')
-rw-r--r-- | sound/usb/line6/pcm.c | 23 | ||||
-rw-r--r-- | sound/usb/line6/pcm.h | 5 |
2 files changed, 6 insertions, 22 deletions
diff --git a/sound/usb/line6/pcm.c b/sound/usb/line6/pcm.c index 9a2a15f4c4e4..adbcac46b785 100644 --- a/sound/usb/line6/pcm.c +++ b/sound/usb/line6/pcm.c | |||
@@ -226,9 +226,8 @@ int snd_line6_trigger(struct snd_pcm_substream *substream, int cmd) | |||
226 | { | 226 | { |
227 | struct snd_line6_pcm *line6pcm = snd_pcm_substream_chip(substream); | 227 | struct snd_line6_pcm *line6pcm = snd_pcm_substream_chip(substream); |
228 | struct snd_pcm_substream *s; | 228 | struct snd_pcm_substream *s; |
229 | int err; | 229 | int err = 0; |
230 | 230 | ||
231 | spin_lock(&line6pcm->lock_trigger); | ||
232 | clear_bit(LINE6_INDEX_PREPARED, &line6pcm->flags); | 231 | clear_bit(LINE6_INDEX_PREPARED, &line6pcm->flags); |
233 | 232 | ||
234 | snd_pcm_group_for_each_entry(s, substream) { | 233 | snd_pcm_group_for_each_entry(s, substream) { |
@@ -237,32 +236,23 @@ int snd_line6_trigger(struct snd_pcm_substream *substream, int cmd) | |||
237 | switch (s->stream) { | 236 | switch (s->stream) { |
238 | case SNDRV_PCM_STREAM_PLAYBACK: | 237 | case SNDRV_PCM_STREAM_PLAYBACK: |
239 | err = snd_line6_playback_trigger(line6pcm, cmd); | 238 | err = snd_line6_playback_trigger(line6pcm, cmd); |
240 | |||
241 | if (err < 0) { | ||
242 | spin_unlock(&line6pcm->lock_trigger); | ||
243 | return err; | ||
244 | } | ||
245 | |||
246 | break; | 239 | break; |
247 | 240 | ||
248 | case SNDRV_PCM_STREAM_CAPTURE: | 241 | case SNDRV_PCM_STREAM_CAPTURE: |
249 | err = snd_line6_capture_trigger(line6pcm, cmd); | 242 | err = snd_line6_capture_trigger(line6pcm, cmd); |
250 | |||
251 | if (err < 0) { | ||
252 | spin_unlock(&line6pcm->lock_trigger); | ||
253 | return err; | ||
254 | } | ||
255 | |||
256 | break; | 243 | break; |
257 | 244 | ||
258 | default: | 245 | default: |
259 | dev_err(line6pcm->line6->ifcdev, | 246 | dev_err(line6pcm->line6->ifcdev, |
260 | "Unknown stream direction %d\n", s->stream); | 247 | "Unknown stream direction %d\n", s->stream); |
248 | err = -EINVAL; | ||
249 | break; | ||
261 | } | 250 | } |
251 | if (err < 0) | ||
252 | break; | ||
262 | } | 253 | } |
263 | 254 | ||
264 | spin_unlock(&line6pcm->lock_trigger); | 255 | return err; |
265 | return 0; | ||
266 | } | 256 | } |
267 | 257 | ||
268 | /* control info callback */ | 258 | /* control info callback */ |
@@ -427,7 +417,6 @@ int line6_init_pcm(struct usb_line6 *line6, | |||
427 | 417 | ||
428 | spin_lock_init(&line6pcm->lock_audio_out); | 418 | spin_lock_init(&line6pcm->lock_audio_out); |
429 | spin_lock_init(&line6pcm->lock_audio_in); | 419 | spin_lock_init(&line6pcm->lock_audio_in); |
430 | spin_lock_init(&line6pcm->lock_trigger); | ||
431 | line6pcm->impulse_period = LINE6_IMPULSE_DEFAULT_PERIOD; | 420 | line6pcm->impulse_period = LINE6_IMPULSE_DEFAULT_PERIOD; |
432 | 421 | ||
433 | line6->line6pcm = line6pcm; | 422 | line6->line6pcm = line6pcm; |
diff --git a/sound/usb/line6/pcm.h b/sound/usb/line6/pcm.h index c742b33666eb..a84753ee0fa2 100644 --- a/sound/usb/line6/pcm.h +++ b/sound/usb/line6/pcm.h | |||
@@ -308,11 +308,6 @@ struct snd_line6_pcm { | |||
308 | spinlock_t lock_audio_in; | 308 | spinlock_t lock_audio_in; |
309 | 309 | ||
310 | /** | 310 | /** |
311 | Spin lock to protect trigger. | ||
312 | */ | ||
313 | spinlock_t lock_trigger; | ||
314 | |||
315 | /** | ||
316 | PCM playback volume (left and right). | 311 | PCM playback volume (left and right). |
317 | */ | 312 | */ |
318 | int volume_playback[2]; | 313 | int volume_playback[2]; |