aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/v4l2-fh.c
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil@xs4all.nl>2011-03-22 10:14:07 -0300
committerMauro Carvalho Chehab <mchehab@redhat.com>2011-03-22 16:38:16 -0300
commitb1a873a37b6551a214ad37d1eee7654a9d65fd6e (patch)
tree3667a3d36c9f7c6ae73609004331f006751c44be /drivers/media/video/v4l2-fh.c
parent2f82441a8644287e5b647329cc30b590f6fd3714 (diff)
downloadkernel_samsung_smdk4412-b1a873a37b6551a214ad37d1eee7654a9d65fd6e.tar.gz
kernel_samsung_smdk4412-b1a873a37b6551a214ad37d1eee7654a9d65fd6e.tar.bz2
kernel_samsung_smdk4412-b1a873a37b6551a214ad37d1eee7654a9d65fd6e.zip
[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.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/media/video/v4l2-fh.c b/drivers/media/video/v4l2-fh.c
index 543b3fe6784..717f71e6370 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)
INIT_LIST_HEAD(&fh->list);
set_bit(V4L2_FL_USES_V4L2_FH, &fh->vdev->flags);
fh->prio = V4L2_PRIORITY_UNSET;
- BUG_ON(vdev->prio == NULL);
/*
* fh->events only needs to be initialized if the driver
@@ -54,7 +53,8 @@ void v4l2_fh_add(struct v4l2_fh *fh)
{
unsigned long flags;
- v4l2_prio_open(fh->vdev->prio, &fh->prio);
+ if (test_bit(V4L2_FL_USE_FH_PRIO, &fh->vdev->flags))
+ v4l2_prio_open(fh->vdev->prio, &fh->prio);
spin_lock_irqsave(&fh->vdev->fh_lock, flags);
list_add(&fh->list, &fh->vdev->fh_list);
spin_unlock_irqrestore(&fh->vdev->fh_lock, flags);
@@ -82,7 +82,8 @@ void v4l2_fh_del(struct v4l2_fh *fh)
spin_lock_irqsave(&fh->vdev->fh_lock, flags);
list_del_init(&fh->list);
spin_unlock_irqrestore(&fh->vdev->fh_lock, flags);
- v4l2_prio_close(fh->vdev->prio, fh->prio);
+ if (test_bit(V4L2_FL_USE_FH_PRIO, &fh->vdev->flags))
+ v4l2_prio_close(fh->vdev->prio, fh->prio);
}
EXPORT_SYMBOL_GPL(v4l2_fh_del);