aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/cx88/cx88-video.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/cx88/cx88-video.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/cx88/cx88-video.c')
-rw-r--r--drivers/media/video/cx88/cx88-video.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/media/video/cx88/cx88-video.c b/drivers/media/video/cx88/cx88-video.c
index ef4d56ea0027..61e03d4703f6 100644
--- a/drivers/media/video/cx88/cx88-video.c
+++ b/drivers/media/video/cx88/cx88-video.c
@@ -773,6 +773,7 @@ static int video_open(struct inode *inode, struct file *file)
773 enum v4l2_buf_type type = 0; 773 enum v4l2_buf_type type = 0;
774 int radio = 0; 774 int radio = 0;
775 775
776 lock_kernel();
776 list_for_each_entry(h, &cx8800_devlist, devlist) { 777 list_for_each_entry(h, &cx8800_devlist, devlist) {
777 if (h->video_dev->minor == minor) { 778 if (h->video_dev->minor == minor) {
778 dev = h; 779 dev = h;
@@ -788,8 +789,10 @@ static int video_open(struct inode *inode, struct file *file)
788 dev = h; 789 dev = h;
789 } 790 }
790 } 791 }
791 if (NULL == dev) 792 if (NULL == dev) {
793 unlock_kernel();
792 return -ENODEV; 794 return -ENODEV;
795 }
793 796
794 core = dev->core; 797 core = dev->core;
795 798
@@ -798,8 +801,10 @@ static int video_open(struct inode *inode, struct file *file)
798 801
799 /* allocate + initialize per filehandle data */ 802 /* allocate + initialize per filehandle data */
800 fh = kzalloc(sizeof(*fh),GFP_KERNEL); 803 fh = kzalloc(sizeof(*fh),GFP_KERNEL);
801 if (NULL == fh) 804 if (NULL == fh) {
805 unlock_kernel();
802 return -ENOMEM; 806 return -ENOMEM;
807 }
803 file->private_data = fh; 808 file->private_data = fh;
804 fh->dev = dev; 809 fh->dev = dev;
805 fh->radio = radio; 810 fh->radio = radio;
@@ -832,6 +837,7 @@ static int video_open(struct inode *inode, struct file *file)
832 cx88_set_stereo(core,V4L2_TUNER_MODE_STEREO,1); 837 cx88_set_stereo(core,V4L2_TUNER_MODE_STEREO,1);
833 cx88_call_i2c_clients(core,AUDC_SET_RADIO,NULL); 838 cx88_call_i2c_clients(core,AUDC_SET_RADIO,NULL);
834 } 839 }
840 unlock_kernel();
835 841
836 return 0; 842 return 0;
837} 843}