aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans Verkuil <hans.verkuil@cisco.com>2011-06-20 10:56:24 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2011-07-27 16:53:34 -0400
commit3f66f0ed319505555f45ceac04775b23f9279ee6 (patch)
tree27796db307bf941b8297b639b4cb2b9a48ffc689
parente969084030b03f4997d63b3f718ba814290e0705 (diff)
[media] v4l2-ctrls/v4l2-events: small coding style cleanups
Thanks to Laurent Pinchart <laurent.pinchart@ideasonboard.com>. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r--drivers/media/video/v4l2-ctrls.c2
-rw-r--r--drivers/media/video/v4l2-event.c6
-rw-r--r--include/media/v4l2-ctrls.h1
-rw-r--r--include/media/v4l2-event.h34
4 files changed, 22 insertions, 21 deletions
diff --git a/drivers/media/video/v4l2-ctrls.c b/drivers/media/video/v4l2-ctrls.c
index cc2b589140d2..a037739868e0 100644
--- a/drivers/media/video/v4l2-ctrls.c
+++ b/drivers/media/video/v4l2-ctrls.c
@@ -586,7 +586,7 @@ static void send_event(struct v4l2_fh *fh, struct v4l2_ctrl *ctrl, u32 changes)
586 struct v4l2_subscribed_event *sev; 586 struct v4l2_subscribed_event *sev;
587 587
588 if (list_empty(&ctrl->ev_subs)) 588 if (list_empty(&ctrl->ev_subs))
589 return; 589 return;
590 fill_event(&ev, ctrl, changes); 590 fill_event(&ev, ctrl, changes);
591 591
592 list_for_each_entry(sev, &ctrl->ev_subs, node) 592 list_for_each_entry(sev, &ctrl->ev_subs, node)
diff --git a/drivers/media/video/v4l2-event.c b/drivers/media/video/v4l2-event.c
index b1c19fc2f08c..53b190cf225e 100644
--- a/drivers/media/video/v4l2-event.c
+++ b/drivers/media/video/v4l2-event.c
@@ -100,10 +100,9 @@ static struct v4l2_subscribed_event *v4l2_event_subscribed(
100 100
101 assert_spin_locked(&fh->vdev->fh_lock); 101 assert_spin_locked(&fh->vdev->fh_lock);
102 102
103 list_for_each_entry(sev, &fh->subscribed, list) { 103 list_for_each_entry(sev, &fh->subscribed, list)
104 if (sev->type == type && sev->id == id) 104 if (sev->type == type && sev->id == id)
105 return sev; 105 return sev;
106 }
107 106
108 return NULL; 107 return NULL;
109} 108}
@@ -169,9 +168,8 @@ void v4l2_event_queue(struct video_device *vdev, const struct v4l2_event *ev)
169 168
170 spin_lock_irqsave(&vdev->fh_lock, flags); 169 spin_lock_irqsave(&vdev->fh_lock, flags);
171 170
172 list_for_each_entry(fh, &vdev->fh_list, list) { 171 list_for_each_entry(fh, &vdev->fh_list, list)
173 __v4l2_event_queue_fh(fh, ev, &timestamp); 172 __v4l2_event_queue_fh(fh, ev, &timestamp);
174 }
175 173
176 spin_unlock_irqrestore(&vdev->fh_lock, flags); 174 spin_unlock_irqrestore(&vdev->fh_lock, flags);
177} 175}
diff --git a/include/media/v4l2-ctrls.h b/include/media/v4l2-ctrls.h
index fe55a4e0324f..13fe4d744aba 100644
--- a/include/media/v4l2-ctrls.h
+++ b/include/media/v4l2-ctrls.h
@@ -31,7 +31,6 @@ struct v4l2_ctrl_helper;
31struct v4l2_ctrl; 31struct v4l2_ctrl;
32struct video_device; 32struct video_device;
33struct v4l2_subdev; 33struct v4l2_subdev;
34struct v4l2_event_subscription;
35struct v4l2_subscribed_event; 34struct v4l2_subscribed_event;
36struct v4l2_fh; 35struct v4l2_fh;
37 36
diff --git a/include/media/v4l2-event.h b/include/media/v4l2-event.h
index 6da793fa4d34..7abeb397d130 100644
--- a/include/media/v4l2-event.h
+++ b/include/media/v4l2-event.h
@@ -33,41 +33,45 @@ struct v4l2_fh;
33struct v4l2_subscribed_event; 33struct v4l2_subscribed_event;
34struct video_device; 34struct video_device;
35 35
36/** struct v4l2_kevent - Internal kernel event struct.
37 * @list: List node for the v4l2_fh->available list.
38 * @sev: Pointer to parent v4l2_subscribed_event.
39 * @event: The event itself.
40 */
36struct v4l2_kevent { 41struct v4l2_kevent {
37 /* list node for the v4l2_fh->available list */
38 struct list_head list; 42 struct list_head list;
39 /* pointer to parent v4l2_subscribed_event */
40 struct v4l2_subscribed_event *sev; 43 struct v4l2_subscribed_event *sev;
41 /* event itself */
42 struct v4l2_event event; 44 struct v4l2_event event;
43}; 45};
44 46
47/** struct v4l2_subscribed_event - Internal struct representing a subscribed event.
48 * @list: List node for the v4l2_fh->subscribed list.
49 * @type: Event type.
50 * @id: Associated object ID (e.g. control ID). 0 if there isn't any.
51 * @flags: Copy of v4l2_event_subscription->flags.
52 * @fh: Filehandle that subscribed to this event.
53 * @node: List node that hooks into the object's event list (if there is one).
54 * @replace: Optional callback that can replace event 'old' with event 'new'.
55 * @merge: Optional callback that can merge event 'old' into event 'new'.
56 * @elems: The number of elements in the events array.
57 * @first: The index of the events containing the oldest available event.
58 * @in_use: The number of queued events.
59 * @events: An array of @elems events.
60 */
45struct v4l2_subscribed_event { 61struct v4l2_subscribed_event {
46 /* list node for the v4l2_fh->subscribed list */
47 struct list_head list; 62 struct list_head list;
48 /* event type */
49 u32 type; 63 u32 type;
50 /* associated object ID (e.g. control ID) */
51 u32 id; 64 u32 id;
52 /* copy of v4l2_event_subscription->flags */
53 u32 flags; 65 u32 flags;
54 /* filehandle that subscribed to this event */
55 struct v4l2_fh *fh; 66 struct v4l2_fh *fh;
56 /* list node that hooks into the object's event list (if there is one) */
57 struct list_head node; 67 struct list_head node;
58 /* Optional callback that can replace event 'old' with event 'new'. */
59 void (*replace)(struct v4l2_event *old, 68 void (*replace)(struct v4l2_event *old,
60 const struct v4l2_event *new); 69 const struct v4l2_event *new);
61 /* Optional callback that can merge event 'old' into event 'new'. */
62 void (*merge)(const struct v4l2_event *old, 70 void (*merge)(const struct v4l2_event *old,
63 struct v4l2_event *new); 71 struct v4l2_event *new);
64 /* the number of elements in the events array */
65 unsigned elems; 72 unsigned elems;
66 /* the index of the events containing the oldest available event */
67 unsigned first; 73 unsigned first;
68 /* the number of queued events */
69 unsigned in_use; 74 unsigned in_use;
70 /* an array of elems events */
71 struct v4l2_kevent events[]; 75 struct v4l2_kevent events[];
72}; 76};
73 77