From 523f46d6aba9dcb0a2d0fc474ca884e93a7cf198 Mon Sep 17 00:00:00 2001 From: Hans Verkuil Date: Mon, 13 Jun 2011 17:44:42 -0300 Subject: [media] v4l2-events/fh: merge v4l2_events into v4l2_fh Drivers that supported events used to be rare, but now that controls can also raise events this will become much more common since almost all drivers have controls. This means that keeping struct v4l2_events as a separate struct make no more sense. Merging it into struct v4l2_fh simplifies things substantially as it is now an integral part of the filehandle struct. Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- include/media/v4l2-event.h | 11 ----------- include/media/v4l2-fh.h | 13 ++++++++++--- 2 files changed, 10 insertions(+), 14 deletions(-) (limited to 'include/media') diff --git a/include/media/v4l2-event.h b/include/media/v4l2-event.h index 45e9c1e0551..042b893035d 100644 --- a/include/media/v4l2-event.h +++ b/include/media/v4l2-event.h @@ -43,17 +43,6 @@ struct v4l2_subscribed_event { u32 id; }; -struct v4l2_events { - wait_queue_head_t wait; - struct list_head subscribed; /* Subscribed events */ - struct list_head free; /* Events ready for use */ - struct list_head available; /* Dequeueable event */ - unsigned int navailable; - unsigned int nallocated; /* Number of allocated events */ - u32 sequence; -}; - -int v4l2_event_init(struct v4l2_fh *fh); int v4l2_event_alloc(struct v4l2_fh *fh, unsigned int n); void v4l2_event_free(struct v4l2_fh *fh); int v4l2_event_dequeue(struct v4l2_fh *fh, struct v4l2_event *event, diff --git a/include/media/v4l2-fh.h b/include/media/v4l2-fh.h index d2471116ad6..bfc0457ca6e 100644 --- a/include/media/v4l2-fh.h +++ b/include/media/v4l2-fh.h @@ -29,15 +29,22 @@ #include struct video_device; -struct v4l2_events; struct v4l2_ctrl_handler; struct v4l2_fh { struct list_head list; struct video_device *vdev; - struct v4l2_events *events; /* events, pending and subscribed */ struct v4l2_ctrl_handler *ctrl_handler; enum v4l2_priority prio; + + /* Events */ + wait_queue_head_t wait; + struct list_head subscribed; /* Subscribed events */ + struct list_head free; /* Events ready for use */ + struct list_head available; /* Dequeueable event */ + unsigned int navailable; + unsigned int nallocated; /* Number of allocated events */ + u32 sequence; }; /* @@ -46,7 +53,7 @@ struct v4l2_fh { * from driver's v4l2_file_operations->open() handler if the driver * uses v4l2_fh. */ -int v4l2_fh_init(struct v4l2_fh *fh, struct video_device *vdev); +void v4l2_fh_init(struct v4l2_fh *fh, struct video_device *vdev); /* * Add the fh to the list of file handles on a video_device. The file * handle must be initialised first. -- cgit v1.2.3