Merge branch 'for-next' into for-linus
[linux-2.6-microblaze.git] / include / sound / pcm.h
index cc175c6..210096f 100644 (file)
@@ -659,6 +659,18 @@ void snd_pcm_stream_unlock_irqrestore(struct snd_pcm_substream *substream,
                flags = _snd_pcm_stream_lock_irqsave_nested(substream); \
        } while (0)
 
+/* definitions for guard(); use like guard(pcm_stream_lock) */
+DEFINE_LOCK_GUARD_1(pcm_stream_lock, struct snd_pcm_substream,
+                   snd_pcm_stream_lock(_T->lock),
+                   snd_pcm_stream_unlock(_T->lock))
+DEFINE_LOCK_GUARD_1(pcm_stream_lock_irq, struct snd_pcm_substream,
+                   snd_pcm_stream_lock_irq(_T->lock),
+                   snd_pcm_stream_unlock_irq(_T->lock))
+DEFINE_LOCK_GUARD_1(pcm_stream_lock_irqsave, struct snd_pcm_substream,
+                   snd_pcm_stream_lock_irqsave(_T->lock, _T->flags),
+                   snd_pcm_stream_unlock_irqrestore(_T->lock, _T->flags),
+                   unsigned long flags)
+
 /**
  * snd_pcm_group_for_each_entry - iterate over the linked substreams
  * @s: the iterator