X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=drivers%2Fsbus%2Fchar%2Fvfc_dev.c;h=d4f8fcded51d8615e1da7cd5996ac715b0defd9e;hb=9489a0625854cd7482bb0e8b37de4406cdcd49e0;hp=26b1d2a17ed2f9f3c15bb03d89d8f2e0739fa60c;hpb=b43035a5ec4deecd43019728ab9347df82dd121f;p=linux-2.6 diff --git a/drivers/sbus/char/vfc_dev.c b/drivers/sbus/char/vfc_dev.c index 26b1d2a17e..d4f8fcded5 100644 --- a/drivers/sbus/char/vfc_dev.c +++ b/drivers/sbus/char/vfc_dev.c @@ -22,6 +22,7 @@ #include #include #include +#include #include #include @@ -54,12 +55,12 @@ static unsigned char saa9051_init_array[VFC_SAA9051_NR] = { void vfc_lock_device(struct vfc_dev *dev) { - down(&dev->device_lock_sem); + mutex_lock(&dev->device_lock_mtx); } void vfc_unlock_device(struct vfc_dev *dev) { - up(&dev->device_lock_sem); + mutex_unlock(&dev->device_lock_mtx); } @@ -133,7 +134,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; @@ -248,6 +249,7 @@ static int vfc_debug(struct vfc_dev *dev, int cmd, void __user *argp) buffer,inout.len); if (copy_to_user(argp,&inout,sizeof(inout))) { + vfc_unlock_device(dev); kfree(buffer); return -EFAULT; }