summaryrefslogtreecommitdiff
path: root/drivers/media
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@s-opensource.com>2017-09-20 00:44:07 +0300
committerMauro Carvalho Chehab <mchehab@s-opensource.com>2017-10-11 20:08:37 +0300
commit999f3d25b87feaaadf39627856d235683ad5268d (patch)
treeed8c932cc6dd7049a1ad5ed7829834a39634c641 /drivers/media
parent0463625ee9e7b7c786460b6c20073e8c8e283466 (diff)
downloadlinux-999f3d25b87feaaadf39627856d235683ad5268d.tar.xz
media: dvb_demux.h: add an enum for DMX_STATE_* and document
kernel-doc allows documenting enums. Also, it makes clearer about the meaning of each field on structures. So, convert DMX_STATE_* to an enum. While here, get rid of the unused DMX_STATE_SET. Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/dvb-core/dvb_demux.h25
1 files changed, 18 insertions, 7 deletions
diff --git a/drivers/media/dvb-core/dvb_demux.h b/drivers/media/dvb-core/dvb_demux.h
index 6bc4b27dbff3..b24d69b5a20f 100644
--- a/drivers/media/dvb-core/dvb_demux.h
+++ b/drivers/media/dvb-core/dvb_demux.h
@@ -37,11 +37,22 @@ enum dvb_dmx_filter_type {
DMX_TYPE_SEC,
};
-#define DMX_STATE_FREE 0
-#define DMX_STATE_ALLOCATED 1
-#define DMX_STATE_SET 2
-#define DMX_STATE_READY 3
-#define DMX_STATE_GO 4
+/**
+ * enum dvb_dmx_state - state machine for a demux filter.
+ *
+ * @DMX_STATE_FREE: indicates that the filter is freed.
+ * @DMX_STATE_ALLOCATED: indicates that the filter was allocated
+ * to be used.
+ * @DMX_STATE_READY: indicates that the filter is ready
+ * to be used.
+ * @DMX_STATE_GO: indicates that the filter is running.
+ */
+enum dvb_dmx_state {
+ DMX_STATE_FREE,
+ DMX_STATE_ALLOCATED,
+ DMX_STATE_READY,
+ DMX_STATE_GO,
+};
#define DVB_DEMUX_MASK_MAX 18
@@ -58,7 +69,7 @@ struct dvb_demux_filter {
struct dvb_demux_filter *next;
struct dvb_demux_feed *feed;
int index;
- int state;
+ enum dvb_dmx_state state;
enum dvb_dmx_filter_type type;
u16 hw_handle;
@@ -81,7 +92,7 @@ struct dvb_demux_feed {
struct dvb_demux *demux;
void *priv;
enum dvb_dmx_filter_type type;
- int state;
+ enum dvb_dmx_state state;
u16 pid;
ktime_t timeout;