aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSylwester Nawrocki <sylvester.nawrocki@gmail.com>2013-01-22 16:58:57 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2013-02-05 12:04:55 -0500
commit4f4d14b70a29c679dd53e367b0d9b007a7117ee3 (patch)
tree3d2acb71e2ea19fe4ee73e4b8c436d68f7aeea88
parent2ccbe779bcdee130ea7f1525670dc9d60318a981 (diff)
[media] V4L: Add v4l2_event_subdev_unsubscribe() helper function
Add a v4l2 core helper function that can be used as the subdev .unsubscribe_event handler. This allows to eliminate some boilerplate from drivers that are only handling the control events. Signed-off-by: Sylwester Nawrocki <sylvester.nawrocki@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r--drivers/media/v4l2-core/v4l2-event.c7
-rw-r--r--include/media/v4l2-event.h4
2 files changed, 10 insertions, 1 deletions
diff --git a/drivers/media/v4l2-core/v4l2-event.c b/drivers/media/v4l2-core/v4l2-event.c
index c72009218152..86dcb5483c42 100644
--- a/drivers/media/v4l2-core/v4l2-event.c
+++ b/drivers/media/v4l2-core/v4l2-event.c
@@ -311,3 +311,10 @@ int v4l2_event_unsubscribe(struct v4l2_fh *fh,
311 return 0; 311 return 0;
312} 312}
313EXPORT_SYMBOL_GPL(v4l2_event_unsubscribe); 313EXPORT_SYMBOL_GPL(v4l2_event_unsubscribe);
314
315int v4l2_event_subdev_unsubscribe(struct v4l2_subdev *sd, struct v4l2_fh *fh,
316 struct v4l2_event_subscription *sub)
317{
318 return v4l2_event_unsubscribe(fh, sub);
319}
320EXPORT_SYMBOL_GPL(v4l2_event_subdev_unsubscribe);
diff --git a/include/media/v4l2-event.h b/include/media/v4l2-event.h
index eff85f934b24..be05d019de25 100644
--- a/include/media/v4l2-event.h
+++ b/include/media/v4l2-event.h
@@ -64,6 +64,7 @@
64 */ 64 */
65 65
66struct v4l2_fh; 66struct v4l2_fh;
67struct v4l2_subdev;
67struct v4l2_subscribed_event; 68struct v4l2_subscribed_event;
68struct video_device; 69struct video_device;
69 70
@@ -129,5 +130,6 @@ int v4l2_event_subscribe(struct v4l2_fh *fh,
129int v4l2_event_unsubscribe(struct v4l2_fh *fh, 130int v4l2_event_unsubscribe(struct v4l2_fh *fh,
130 const struct v4l2_event_subscription *sub); 131 const struct v4l2_event_subscription *sub);
131void v4l2_event_unsubscribe_all(struct v4l2_fh *fh); 132void v4l2_event_unsubscribe_all(struct v4l2_fh *fh);
132 133int v4l2_event_subdev_unsubscribe(struct v4l2_subdev *sd, struct v4l2_fh *fh,
134 struct v4l2_event_subscription *sub);
133#endif /* V4L2_EVENT_H */ 135#endif /* V4L2_EVENT_H */