X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=drivers%2Fsbus%2Fchar%2Fvfc_dev.c;h=1f6cb8ae2784cddaf76aa949033381b271126037;hb=5ab0854dd77a520abe7c3b9c7770972fd3e61e90;hp=e7a1642b2aa4c528baa0aa4f1bf85f6f970fe6ce;hpb=2843483d2eb02ad104edbe8b2429fb6a39d25063;p=linux-2.6 diff --git a/drivers/sbus/char/vfc_dev.c b/drivers/sbus/char/vfc_dev.c index e7a1642b2a..1f6cb8ae27 100644 --- a/drivers/sbus/char/vfc_dev.c +++ b/drivers/sbus/char/vfc_dev.c @@ -24,6 +24,7 @@ #include #include #include +#include #include #include @@ -134,7 +135,7 @@ int init_vfc_hw(struct vfc_dev *dev) int init_vfc_devstruct(struct vfc_dev *dev, int instance) { dev->instance=instance; - init_MUTEX(&dev->device_lock_sem); + mutex_init(&dev->device_lock_mtx); dev->control_reg=0; dev->busy=0; return 0; @@ -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; }