diff options
author | Hans Verkuil <hverkuil@xs4all.nl> | 2011-03-22 09:14:07 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2011-03-22 15:38:16 -0400 |
commit | b1a873a37b6551a214ad37d1eee7654a9d65fd6e (patch) | |
tree | 3667a3d36c9f7c6ae73609004331f006751c44be /drivers/media/video/v4l2-fh.c | |
parent | 2f82441a8644287e5b647329cc30b590f6fd3714 (diff) |
[media] v4l2: use new flag to enable core priority handling
Rather than guess which driver supports core priority handling, require drivers
that do to explicitly set the V4L2_FL_USE_FH_PRIO flag in video_device.
Updated the core prio handling accordingly and set the flag in the three
drivers that do.
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/v4l2-fh.c')
-rw-r--r-- | drivers/media/video/v4l2-fh.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/media/video/v4l2-fh.c b/drivers/media/video/v4l2-fh.c index 543b3fe6784e..717f71e6370e 100644 --- a/drivers/media/video/v4l2-fh.c +++ b/drivers/media/video/v4l2-fh.c | |||
@@ -35,7 +35,6 @@ int v4l2_fh_init(struct v4l2_fh *fh, struct video_device *vdev) | |||
35 | INIT_LIST_HEAD(&fh->list); | 35 | INIT_LIST_HEAD(&fh->list); |
36 | set_bit(V4L2_FL_USES_V4L2_FH, &fh->vdev->flags); | 36 | set_bit(V4L2_FL_USES_V4L2_FH, &fh->vdev->flags); |
37 | fh->prio = V4L2_PRIORITY_UNSET; | 37 | fh->prio = V4L2_PRIORITY_UNSET; |
38 | BUG_ON(vdev->prio == NULL); | ||
39 | 38 | ||
40 | /* | 39 | /* |
41 | * fh->events only needs to be initialized if the driver | 40 | * fh->events only needs to be initialized if the driver |
@@ -54,7 +53,8 @@ void v4l2_fh_add(struct v4l2_fh *fh) | |||
54 | { | 53 | { |
55 | unsigned long flags; | 54 | unsigned long flags; |
56 | 55 | ||
57 | v4l2_prio_open(fh->vdev->prio, &fh->prio); | 56 | if (test_bit(V4L2_FL_USE_FH_PRIO, &fh->vdev->flags)) |
57 | v4l2_prio_open(fh->vdev->prio, &fh->prio); | ||
58 | spin_lock_irqsave(&fh->vdev->fh_lock, flags); | 58 | spin_lock_irqsave(&fh->vdev->fh_lock, flags); |
59 | list_add(&fh->list, &fh->vdev->fh_list); | 59 | list_add(&fh->list, &fh->vdev->fh_list); |
60 | spin_unlock_irqrestore(&fh->vdev->fh_lock, flags); | 60 | spin_unlock_irqrestore(&fh->vdev->fh_lock, flags); |
@@ -82,7 +82,8 @@ void v4l2_fh_del(struct v4l2_fh *fh) | |||
82 | spin_lock_irqsave(&fh->vdev->fh_lock, flags); | 82 | spin_lock_irqsave(&fh->vdev->fh_lock, flags); |
83 | list_del_init(&fh->list); | 83 | list_del_init(&fh->list); |
84 | spin_unlock_irqrestore(&fh->vdev->fh_lock, flags); | 84 | spin_unlock_irqrestore(&fh->vdev->fh_lock, flags); |
85 | v4l2_prio_close(fh->vdev->prio, fh->prio); | 85 | if (test_bit(V4L2_FL_USE_FH_PRIO, &fh->vdev->flags)) |
86 | v4l2_prio_close(fh->vdev->prio, fh->prio); | ||
86 | } | 87 | } |
87 | EXPORT_SYMBOL_GPL(v4l2_fh_del); | 88 | EXPORT_SYMBOL_GPL(v4l2_fh_del); |
88 | 89 | ||