summaryrefslogtreecommitdiffstats
path: root/drivers/media/video/pvrusb2/pvrusb2-v4l2.c
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil@xs4all.nl>2008-07-30 08:43:36 -0300
committerMauro Carvalho Chehab <mchehab@redhat.com>2008-10-12 09:36:47 -0200
commitd56dc61265d2527a63ab5b0f03199a43cd89ca36 (patch)
treebea2a5b12fc120ca6e8797b2f16ad9696e0f25dd /drivers/media/video/pvrusb2/pvrusb2-v4l2.c
parent95f73c5b57990c97047c200b8746ab62a360c5bc (diff)
V4L/DVB (8613): v4l: move BKL down to the driver level.
The BKL is now moved from the video_open function in v4l2-dev.c to the various drivers. It seems about a third of the drivers already has a lock of some sort protecting the open(), another third uses video_exclusive_open (yuck!) and the last third required adding the BKL in their open function. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/pvrusb2/pvrusb2-v4l2.c')
-rw-r--r--drivers/media/video/pvrusb2/pvrusb2-v4l2.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/media/video/pvrusb2/pvrusb2-v4l2.c b/drivers/media/video/pvrusb2/pvrusb2-v4l2.c
index 00306faeac0..26ffaa276c5 100644
--- a/drivers/media/video/pvrusb2/pvrusb2-v4l2.c
+++ b/drivers/media/video/pvrusb2/pvrusb2-v4l2.c
@@ -932,6 +932,7 @@ static int pvr2_v4l2_open(struct inode *inode, struct file *file)
unsigned int input_cnt,idx;
int ret = 0;
+ lock_kernel();
dip = container_of(video_devdata(file),struct pvr2_v4l2_dev,devbase);
vp = dip->v4lp;
@@ -942,11 +943,13 @@ static int pvr2_v4l2_open(struct inode *inode, struct file *file)
if (!pvr2_hdw_dev_ok(hdw)) {
pvr2_trace(PVR2_TRACE_OPEN_CLOSE,
"pvr2_v4l2_open: hardware not ready");
+ unlock_kernel();
return -EIO;
}
fhp = kzalloc(sizeof(*fhp),GFP_KERNEL);
if (!fhp) {
+ unlock_kernel();
return -ENOMEM;
}
@@ -976,6 +979,7 @@ static int pvr2_v4l2_open(struct inode *inode, struct file *file)
fhp);
kfree(fhp);
+ unlock_kernel();
return ret;
}
@@ -992,6 +996,7 @@ static int pvr2_v4l2_open(struct inode *inode, struct file *file)
"Destroying pvr_v4l2_fh id=%p (input map failure)",
fhp);
kfree(fhp);
+ unlock_kernel();
return -ENOMEM;
}
input_cnt = 0;
@@ -1015,6 +1020,7 @@ static int pvr2_v4l2_open(struct inode *inode, struct file *file)
v4l2_prio_open(&vp->prio,&fhp->prio);
fhp->fw_mode_flag = pvr2_hdw_cpufw_get_enabled(hdw);
+ unlock_kernel();
return 0;
}