aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/pvrusb2/pvrusb2-v4l2.c
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil@xs4all.nl>2008-07-30 07:43:36 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2008-10-12 07:36:47 -0400
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 00306faeac01..26ffaa276c51 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)
932 unsigned int input_cnt,idx; 932 unsigned int input_cnt,idx;
933 int ret = 0; 933 int ret = 0;
934 934
935 lock_kernel();
935 dip = container_of(video_devdata(file),struct pvr2_v4l2_dev,devbase); 936 dip = container_of(video_devdata(file),struct pvr2_v4l2_dev,devbase);
936 937
937 vp = dip->v4lp; 938 vp = dip->v4lp;
@@ -942,11 +943,13 @@ static int pvr2_v4l2_open(struct inode *inode, struct file *file)
942 if (!pvr2_hdw_dev_ok(hdw)) { 943 if (!pvr2_hdw_dev_ok(hdw)) {
943 pvr2_trace(PVR2_TRACE_OPEN_CLOSE, 944 pvr2_trace(PVR2_TRACE_OPEN_CLOSE,
944 "pvr2_v4l2_open: hardware not ready"); 945 "pvr2_v4l2_open: hardware not ready");
946 unlock_kernel();
945 return -EIO; 947 return -EIO;
946 } 948 }
947 949
948 fhp = kzalloc(sizeof(*fhp),GFP_KERNEL); 950 fhp = kzalloc(sizeof(*fhp),GFP_KERNEL);
949 if (!fhp) { 951 if (!fhp) {
952 unlock_kernel();
950 return -ENOMEM; 953 return -ENOMEM;
951 } 954 }
952 955
@@ -976,6 +979,7 @@ static int pvr2_v4l2_open(struct inode *inode, struct file *file)
976 fhp); 979 fhp);
977 980
978 kfree(fhp); 981 kfree(fhp);
982 unlock_kernel();
979 return ret; 983 return ret;
980 } 984 }
981 985
@@ -992,6 +996,7 @@ static int pvr2_v4l2_open(struct inode *inode, struct file *file)
992 "Destroying pvr_v4l2_fh id=%p (input map failure)", 996 "Destroying pvr_v4l2_fh id=%p (input map failure)",
993 fhp); 997 fhp);
994 kfree(fhp); 998 kfree(fhp);
999 unlock_kernel();
995 return -ENOMEM; 1000 return -ENOMEM;
996 } 1001 }
997 input_cnt = 0; 1002 input_cnt = 0;
@@ -1015,6 +1020,7 @@ static int pvr2_v4l2_open(struct inode *inode, struct file *file)
1015 v4l2_prio_open(&vp->prio,&fhp->prio); 1020 v4l2_prio_open(&vp->prio,&fhp->prio);
1016 1021
1017 fhp->fw_mode_flag = pvr2_hdw_cpufw_get_enabled(hdw); 1022 fhp->fw_mode_flag = pvr2_hdw_cpufw_get_enabled(hdw);
1023 unlock_kernel();
1018 1024
1019 return 0; 1025 return 0;
1020} 1026}