summaryrefslogtreecommitdiffstats
path: root/drivers/media/video/zr364xx.c
diff options
context:
space:
mode:
authorAntoine Jacquet <royale@zerezo.com>2008-08-18 22:09:53 +0200
committerMauro Carvalho Chehab <mchehab@redhat.com>2008-10-12 13:36:51 +0200
commit69025c934b21a9ce49a76dfef59f1ebdfbe96c78 (patch)
treea7dfe3af39d8e25d2bbb0b26042e5478be8c0e78 /drivers/media/video/zr364xx.c
parentV4L/DVB (8730): drx397xD: fix compilation error caused by changeset 71046dfb0853 (diff)
downloadlinux-69025c934b21a9ce49a76dfef59f1ebdfbe96c78.tar.xz
linux-69025c934b21a9ce49a76dfef59f1ebdfbe96c78.zip
V4L/DVB (8731): zr364xx: remove BKL
Remove the Big Kernel Lock from zr364xx driver after pushdown. Now using an internal locking mecanism on open(). Signed-off-by: Antoine Jacquet <royale@zerezo.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/zr364xx.c')
-rw-r--r--drivers/media/video/zr364xx.c23
1 files changed, 10 insertions, 13 deletions
diff --git a/drivers/media/video/zr364xx.c b/drivers/media/video/zr364xx.c
index 4e1ef10d22df..9d5d5985a7ea 100644
--- a/drivers/media/video/zr364xx.c
+++ b/drivers/media/video/zr364xx.c
@@ -641,25 +641,23 @@ static int zr364xx_open(struct inode *inode, struct file *file)
DBG("zr364xx_open");
+ mutex_lock(&cam->lock);
+
cam->skip = 2;
- lock_kernel();
err = video_exclusive_open(inode, file);
- if (err < 0) {
- unlock_kernel();
- return err;
- }
+ if (err < 0)
+ goto out;
if (!cam->framebuf) {
cam->framebuf = vmalloc_32(MAX_FRAME_SIZE * FRAMES);
if (!cam->framebuf) {
info("vmalloc_32 failed!");
- unlock_kernel();
- return -ENOMEM;
+ err = -ENOMEM;
+ goto out;
}
}
- mutex_lock(&cam->lock);
for (i = 0; init[cam->method][i].size != -1; i++) {
err =
send_control_msg(udev, 1, init[cam->method][i].value,
@@ -667,9 +665,7 @@ static int zr364xx_open(struct inode *inode, struct file *file)
init[cam->method][i].size);
if (err < 0) {
info("error during open sequence: %d", i);
- mutex_unlock(&cam->lock);
- unlock_kernel();
- return err;
+ goto out;
}
}
@@ -679,10 +675,11 @@ static int zr364xx_open(struct inode *inode, struct file *file)
* like Ekiga does during its startup, can crash the webcam
*/
mdelay(100);
+ err = 0;
+out:
mutex_unlock(&cam->lock);
- unlock_kernel();
- return 0;
+ return err;
}