summaryrefslogtreecommitdiff
path: root/linux/drivers
diff options
context:
space:
mode:
authorAntoine Jacquet <royale@zerezo.com>2008-08-18 22:09:53 +0200
committerAntoine Jacquet <royale@zerezo.com>2008-08-18 22:09:53 +0200
commit677ec00d28b905a78c8fa5f623be5f29ac1e384a (patch)
treeb1370ecefab78c1bd6eb775bd2923f64432ddcc1 /linux/drivers
parent4b41f2267b44ed49beacd512a3ace46889906922 (diff)
downloadmediapointer-dvb-s2-677ec00d28b905a78c8fa5f623be5f29ac1e384a.tar.gz
mediapointer-dvb-s2-677ec00d28b905a78c8fa5f623be5f29ac1e384a.tar.bz2
zr364xx: remove BKL
From: Antoine Jacquet <royale@zerezo.com> Remove the Big Kernel Lock from zr364xx driver after pushdown. Now using an internal locking mecanism on open(). Priority: normal Signed-off-by: Antoine Jacquet <royale@zerezo.com>
Diffstat (limited to 'linux/drivers')
-rw-r--r--linux/drivers/media/video/zr364xx.c23
1 files changed, 10 insertions, 13 deletions
diff --git a/linux/drivers/media/video/zr364xx.c b/linux/drivers/media/video/zr364xx.c
index dbfdd6966..9d07e6185 100644
--- a/linux/drivers/media/video/zr364xx.c
+++ b/linux/drivers/media/video/zr364xx.c
@@ -642,25 +642,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,
@@ -668,9 +666,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;
}
}
@@ -680,10 +676,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;
}