summaryrefslogtreecommitdiffstats
path: root/sound/firewire/amdtp.h
diff options
context:
space:
mode:
authorClemens Ladisch <clemens@ladisch.de>2011-09-04 22:15:44 +0200
committerClemens Ladisch <clemens@ladisch.de>2013-10-20 22:07:57 +0200
commit20b65dd040ce38e2bc0fa3cae13b954c865b61fe (patch)
tree27b8ae49b43b2b6b4e6635128936ebfcfd20d75c /sound/firewire/amdtp.h
parent9dd81e3143b57d1bf7e8377ab29b86090baa55a8 (diff)
downloadlinux-20b65dd040ce38e2bc0fa3cae13b954c865b61fe.tar.bz2
ALSA: firewire: introduce amdtp_out_stream_running()
Introduce the helper function amdtp_out_stream_running(). This makes many checks in amdtp.c clearer and frees the device drivers from having to track this with a separate variable. Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Diffstat (limited to 'sound/firewire/amdtp.h')
-rw-r--r--sound/firewire/amdtp.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/sound/firewire/amdtp.h b/sound/firewire/amdtp.h
index fd4ce3030279..28b1bf5891e6 100644
--- a/sound/firewire/amdtp.h
+++ b/sound/firewire/amdtp.h
@@ -1,6 +1,7 @@
#ifndef SOUND_FIREWIRE_AMDTP_H_INCLUDED
#define SOUND_FIREWIRE_AMDTP_H_INCLUDED
+#include <linux/err.h>
#include <linux/interrupt.h>
#include <linux/mutex.h>
#include "packets-buffer.h"
@@ -92,6 +93,11 @@ void amdtp_out_stream_pcm_prepare(struct amdtp_out_stream *s);
unsigned long amdtp_out_stream_pcm_pointer(struct amdtp_out_stream *s);
void amdtp_out_stream_pcm_abort(struct amdtp_out_stream *s);
+static inline bool amdtp_out_stream_running(struct amdtp_out_stream *s)
+{
+ return !IS_ERR(s->context);
+}
+
/**
* amdtp_out_stream_set_pcm - configure format of PCM samples
* @s: the AMDTP output stream to be configured