aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/vivi.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/vivi.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/vivi.c')
-rw-r--r--drivers/media/video/vivi.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/media/video/vivi.c b/drivers/media/video/vivi.c
index 8ba8daafd7ea..65c8af18e767 100644
--- a/drivers/media/video/vivi.c
+++ b/drivers/media/video/vivi.c
@@ -898,9 +898,11 @@ static int vivi_open(struct inode *inode, struct file *file)
898 898
899 printk(KERN_DEBUG "vivi: open called (minor=%d)\n", minor); 899 printk(KERN_DEBUG "vivi: open called (minor=%d)\n", minor);
900 900
901 lock_kernel();
901 list_for_each_entry(dev, &vivi_devlist, vivi_devlist) 902 list_for_each_entry(dev, &vivi_devlist, vivi_devlist)
902 if (dev->vfd->minor == minor) 903 if (dev->vfd->minor == minor)
903 goto found; 904 goto found;
905 unlock_kernel();
904 return -ENODEV; 906 return -ENODEV;
905 907
906found: 908found:
@@ -925,8 +927,10 @@ found:
925 } 927 }
926unlock: 928unlock:
927 mutex_unlock(&dev->mutex); 929 mutex_unlock(&dev->mutex);
928 if (retval) 930 if (retval) {
931 unlock_kernel();
929 return retval; 932 return retval;
933 }
930 934
931 file->private_data = fh; 935 file->private_data = fh;
932 fh->dev = dev; 936 fh->dev = dev;
@@ -955,6 +959,7 @@ unlock:
955 sizeof(struct vivi_buffer), fh); 959 sizeof(struct vivi_buffer), fh);
956 960
957 vivi_start_thread(fh); 961 vivi_start_thread(fh);
962 unlock_kernel();
958 963
959 return 0; 964 return 0;
960} 965}