aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/em28xx
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/em28xx
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/em28xx')
-rw-r--r--drivers/media/video/em28xx/em28xx-video.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/media/video/em28xx/em28xx-video.c b/drivers/media/video/em28xx/em28xx-video.c
index 49ab0629702e..600b340e3550 100644
--- a/drivers/media/video/em28xx/em28xx-video.c
+++ b/drivers/media/video/em28xx/em28xx-video.c
@@ -1512,6 +1512,7 @@ static int em28xx_v4l2_open(struct inode *inode, struct file *filp)
1512 struct em28xx_fh *fh; 1512 struct em28xx_fh *fh;
1513 enum v4l2_buf_type fh_type = 0; 1513 enum v4l2_buf_type fh_type = 0;
1514 1514
1515 lock_kernel();
1515 list_for_each_entry(h, &em28xx_devlist, devlist) { 1516 list_for_each_entry(h, &em28xx_devlist, devlist) {
1516 if (h->vdev->minor == minor) { 1517 if (h->vdev->minor == minor) {
1517 dev = h; 1518 dev = h;
@@ -1527,8 +1528,10 @@ static int em28xx_v4l2_open(struct inode *inode, struct file *filp)
1527 dev = h; 1528 dev = h;
1528 } 1529 }
1529 } 1530 }
1530 if (NULL == dev) 1531 if (NULL == dev) {
1532 unlock_kernel();
1531 return -ENODEV; 1533 return -ENODEV;
1534 }
1532 1535
1533 em28xx_videodbg("open minor=%d type=%s users=%d\n", 1536 em28xx_videodbg("open minor=%d type=%s users=%d\n",
1534 minor, v4l2_type_names[fh_type], dev->users); 1537 minor, v4l2_type_names[fh_type], dev->users);
@@ -1537,6 +1540,7 @@ static int em28xx_v4l2_open(struct inode *inode, struct file *filp)
1537 fh = kzalloc(sizeof(struct em28xx_fh), GFP_KERNEL); 1540 fh = kzalloc(sizeof(struct em28xx_fh), GFP_KERNEL);
1538 if (!fh) { 1541 if (!fh) {
1539 em28xx_errdev("em28xx-video.c: Out of memory?!\n"); 1542 em28xx_errdev("em28xx-video.c: Out of memory?!\n");
1543 unlock_kernel();
1540 return -ENOMEM; 1544 return -ENOMEM;
1541 } 1545 }
1542 mutex_lock(&dev->lock); 1546 mutex_lock(&dev->lock);
@@ -1573,6 +1577,7 @@ static int em28xx_v4l2_open(struct inode *inode, struct file *filp)
1573 sizeof(struct em28xx_buffer), fh); 1577 sizeof(struct em28xx_buffer), fh);
1574 1578
1575 mutex_unlock(&dev->lock); 1579 mutex_unlock(&dev->lock);
1580 unlock_kernel();
1576 1581
1577 return errCode; 1582 return errCode;
1578} 1583}