[media] V4L: Add v4l2_event_subdev_unsubscribe() helper function
authorSylwester Nawrocki <sylvester.nawrocki@gmail.com>
Tue, 22 Jan 2013 21:58:57 +0000 (18:58 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Tue, 5 Feb 2013 17:04:55 +0000 (15:04 -0200)
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>
drivers/media/v4l2-core/v4l2-event.c
include/media/v4l2-event.h

index c7200921815282a11e0afa1804840fa803e07917..86dcb5483c4219da6d86d2c3423a8c857449256b 100644 (file)
@@ -311,3 +311,10 @@ int v4l2_event_unsubscribe(struct v4l2_fh *fh,
        return 0;
 }
 EXPORT_SYMBOL_GPL(v4l2_event_unsubscribe);
+
+int v4l2_event_subdev_unsubscribe(struct v4l2_subdev *sd, struct v4l2_fh *fh,
+                                 struct v4l2_event_subscription *sub)
+{
+       return v4l2_event_unsubscribe(fh, sub);
+}
+EXPORT_SYMBOL_GPL(v4l2_event_subdev_unsubscribe);
index eff85f934b247a70f6a4cd6cd0b445ad79f23663..be05d019de25e17f8aa3f5ec4698810f17ec4795 100644 (file)
@@ -64,6 +64,7 @@
  */
 
 struct v4l2_fh;
+struct v4l2_subdev;
 struct v4l2_subscribed_event;
 struct video_device;
 
@@ -129,5 +130,6 @@ int v4l2_event_subscribe(struct v4l2_fh *fh,
 int v4l2_event_unsubscribe(struct v4l2_fh *fh,
                           const struct v4l2_event_subscription *sub);
 void v4l2_event_unsubscribe_all(struct v4l2_fh *fh);
-
+int v4l2_event_subdev_unsubscribe(struct v4l2_subdev *sd, struct v4l2_fh *fh,
+                                 struct v4l2_event_subscription *sub);
 #endif /* V4L2_EVENT_H */