Skip to content

Commit

Permalink
[media] V4L: Add v4l2_event_subdev_unsubscribe() helper function
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Sylwester Nawrocki authored and Mauro Carvalho Chehab committed Feb 5, 2013
1 parent 2ccbe77 commit 4f4d14b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
7 changes: 7 additions & 0 deletions drivers/media/v4l2-core/v4l2-event.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
4 changes: 3 additions & 1 deletion include/media/v4l2-event.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
*/

struct v4l2_fh;
struct v4l2_subdev;
struct v4l2_subscribed_event;
struct video_device;

Expand Down Expand Up @@ -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 */

0 comments on commit 4f4d14b

Please sign in to comment.