From 20b65dd040ce38e2bc0fa3cae13b954c865b61fe Mon Sep 17 00:00:00 2001 From: Clemens Ladisch Date: Sun, 4 Sep 2011 22:15:44 +0200 Subject: 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 --- sound/firewire/amdtp.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'sound/firewire/amdtp.h') 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 #include #include #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 -- cgit