diff options
author | Javier Martinez Canillas <martinez.javier@gmail.com> | 2011-01-03 14:43:52 +0100 |
---|---|---|
committer | Javier Martinez Canillas <martinez.javier@gmail.com> | 2011-01-03 14:43:52 +0100 |
commit | 1ccbbfdcf9d8e0ae6c15fc7c2ab5fffa63c190ca (patch) | |
tree | f5f54bf5217139ebe68d84d71888cefd5897b101 | |
parent | 0c3d783548c04c43a046ac3b75940faccf556e2c (diff) | |
download | ldd3-1ccbbfdcf9d8e0ae6c15fc7c2ab5fffa63c190ca.tar.gz |
scull: access: Use sema_ini() instead init_MUTEX()
-rw-r--r-- | scull/access.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/scull/access.c b/scull/access.c index b534721..141ff80 100644 --- a/scull/access.c +++ b/scull/access.c @@ -82,7 +82,7 @@ struct file_operations scull_sngl_fops = { .llseek = scull_llseek, .read = scull_read, .write = scull_write, - .ioctl = scull_ioctl, + .unlocked_ioctl = scull_ioctl, .open = scull_s_open, .release = scull_s_release, }; @@ -144,7 +144,7 @@ struct file_operations scull_user_fops = { .llseek = scull_llseek, .read = scull_read, .write = scull_write, - .ioctl = scull_ioctl, + .unlocked_ioctl = scull_ioctl, .open = scull_u_open, .release = scull_u_release, }; @@ -217,7 +217,7 @@ struct file_operations scull_wusr_fops = { .llseek = scull_llseek, .read = scull_read, .write = scull_write, - .ioctl = scull_ioctl, + .unlocked_ioctl = scull_ioctl, .open = scull_w_open, .release = scull_w_release, }; @@ -263,7 +263,7 @@ static struct scull_dev *scull_c_lookfor_device(dev_t key) memset(lptr, 0, sizeof(struct scull_listitem)); lptr->key = key; scull_trim(&(lptr->device)); /* initialize it */ - init_MUTEX(&(lptr->device.sem)); + sema_init(&(lptr->device.sem), 1); /* place it in the list */ list_add(&lptr->list, &scull_c_list); @@ -316,7 +316,7 @@ struct file_operations scull_priv_fops = { .llseek = scull_llseek, .read = scull_read, .write = scull_write, - .ioctl = scull_ioctl, + .unlocked_ioctl = scull_ioctl, .open = scull_c_open, .release = scull_c_release, }; @@ -349,7 +349,7 @@ static void scull_access_setup (dev_t devno, struct scull_adev_info *devinfo) /* Initialize the device structure */ dev->quantum = scull_quantum; dev->qset = scull_qset; - init_MUTEX(&dev->sem); + sema_init(&dev->sem, 1); /* Do the cdev stuff. */ cdev_init(&dev->cdev, devinfo->fops); |