aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Corbet <corbet@lwn.net>2008-05-16 14:08:58 -0600
committerJonathan Corbet <corbet@lwn.net>2008-06-20 14:05:52 -0600
commit9aaf20cbf5b7cccd45495326cba0b35b2884e6b3 (patch)
tree3ea3a744d020ec4d4822518fb518cc8fc43324ad
parent5e9829ad38c24aa71252e643836e7cedcb1c83d7 (diff)
videopix: BKL pushdown
Add explicit lock_kernel() calls to vfc_open(). Signed-off-by: Jonathan Corbet <corbet@lwn.net>
-rw-r--r--drivers/sbus/char/vfc_dev.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/sbus/char/vfc_dev.c b/drivers/sbus/char/vfc_dev.c
index d4f8fcded51..1f6cb8ae278 100644
--- a/drivers/sbus/char/vfc_dev.c
+++ b/drivers/sbus/char/vfc_dev.c
@@ -24,6 +24,7 @@
#include <linux/spinlock.h>
#include <linux/mutex.h>
#include <linux/mm.h>
+#include <linux/smp_lock.h>
#include <asm/openprom.h>
#include <asm/oplib.h>
@@ -178,14 +179,17 @@ static int vfc_open(struct inode *inode, struct file *file)
{
struct vfc_dev *dev;
+ lock_kernel();
spin_lock(&vfc_dev_lock);
dev = vfc_get_dev_ptr(iminor(inode));
if (dev == NULL) {
spin_unlock(&vfc_dev_lock);
+ unlock_kernel();
return -ENODEV;
}
if (dev->busy) {
spin_unlock(&vfc_dev_lock);
+ unlock_kernel();
return -EBUSY;
}
@@ -202,6 +206,7 @@ static int vfc_open(struct inode *inode, struct file *file)
vfc_captstat_reset(dev);
vfc_unlock_device(dev);
+ unlock_kernel();
return 0;
}