Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 196953
b: refs/heads/master
c: b1f2ac0
h: refs/heads/master
i:
  196951: fd981ae
v: v3
  • Loading branch information
Arnd Bergmann authored and Greg Kroah-Hartman committed May 11, 2010
1 parent a05b0b6 commit c633928
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 14 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 59200df52cf7d4bfb93aeb30289a8e9d2af3058d
refs/heads/master: b1f2ac07636aadee5cb077fc7e830908b00fcaae
13 changes: 9 additions & 4 deletions trunk/drivers/staging/crystalhd/crystalhd_lnx.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
***************************************************************************/

#include <linux/version.h>
#include <linux/smp_lock.h>
#include <linux/slab.h>

#include "crystalhd_lnx.h"
Expand Down Expand Up @@ -261,12 +262,12 @@ static int chd_dec_api_cmd(struct crystalhd_adp *adp, unsigned long ua,
}

/* API interfaces */
static int chd_dec_ioctl(struct inode *in, struct file *fd,
unsigned int cmd, unsigned long ua)
static long chd_dec_ioctl(struct file *fd, unsigned int cmd, unsigned long ua)
{
struct crystalhd_adp *adp = chd_get_adp();
crystalhd_cmd_proc cproc;
struct crystalhd_user *uc;
int ret;

if (!adp || !fd) {
BCMLOG_ERR("Invalid adp\n");
Expand All @@ -279,13 +280,17 @@ static int chd_dec_ioctl(struct inode *in, struct file *fd,
return -ENODATA;
}

lock_kernel();
cproc = crystalhd_get_cmd_proc(&adp->cmds, cmd, uc);
if (!cproc) {
BCMLOG_ERR("Unhandled command: %d\n", cmd);
unlock_kernel();
return -EINVAL;
}

return chd_dec_api_cmd(adp, ua, uc->uid, cmd, cproc);
ret = chd_dec_api_cmd(adp, ua, uc->uid, cmd, cproc);
unlock_kernel();
return ret;
}

static int chd_dec_open(struct inode *in, struct file *fd)
Expand Down Expand Up @@ -345,7 +350,7 @@ static int chd_dec_close(struct inode *in, struct file *fd)

static const struct file_operations chd_dec_fops = {
.owner = THIS_MODULE,
.ioctl = chd_dec_ioctl,
.unlocked_ioctl = chd_dec_ioctl,
.open = chd_dec_open,
.release = chd_dec_close,
};
Expand Down
24 changes: 18 additions & 6 deletions trunk/drivers/staging/dt3155/dt3155_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ extern void printques(int);
#include <linux/types.h>
#include <linux/poll.h>
#include <linux/sched.h>
#include <linux/smp_lock.h>

#include <asm/io.h>
#include <asm/uaccess.h>
Expand Down Expand Up @@ -835,19 +836,30 @@ static unsigned int dt3155_poll (struct file * filp, poll_table *wait)
return 0;
}

static long
dt3155_unlocked_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
{
int ret;

lock_kernel();
ret = dt3155_ioctl(file->f_path.dentry->d_inode, file, cmd, arg);
unlock_kernel();

return ret;
}

/*****************************************************
* file operations supported by DT3155 driver
* needed by init_module
* register_chrdev
*****************************************************/
static struct file_operations dt3155_fops = {
read: dt3155_read,
ioctl: dt3155_ioctl,
mmap: dt3155_mmap,
poll: dt3155_poll,
open: dt3155_open,
release: dt3155_close
.read = dt3155_read,
.unlocked_ioctl = dt3155_unlocked_ioctl,
.mmap = dt3155_mmap,
.poll = dt3155_poll,
.open = dt3155_open,
.release = dt3155_close
};


Expand Down
18 changes: 15 additions & 3 deletions trunk/drivers/staging/vme/devices/vme_user.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
#include <linux/slab.h>
#include <linux/spinlock.h>
#include <linux/syscalls.h>
#include <linux/smp_lock.h>
#include <linux/types.h>

#include <asm/io.h>
Expand Down Expand Up @@ -130,8 +131,7 @@ static int vme_user_release(struct inode *, struct file *);
static ssize_t vme_user_read(struct file *, char *, size_t, loff_t *);
static ssize_t vme_user_write(struct file *, const char *, size_t, loff_t *);
static loff_t vme_user_llseek(struct file *, loff_t, int);
static int vme_user_ioctl(struct inode *, struct file *, unsigned int,
unsigned long);
static long vme_user_unlocked_ioctl(struct file *, unsigned int, unsigned long);

static int __init vme_user_probe(struct device *, int, int);
static int __exit vme_user_remove(struct device *, int, int);
Expand All @@ -142,7 +142,7 @@ static struct file_operations vme_user_fops = {
.read = vme_user_read,
.write = vme_user_write,
.llseek = vme_user_llseek,
.ioctl = vme_user_ioctl,
.unlocked_ioctl = vme_user_unlocked_ioctl,
};


Expand Down Expand Up @@ -555,6 +555,18 @@ static int vme_user_ioctl(struct inode *inode, struct file *file,
return -EINVAL;
}

static long
vme_user_unlocked_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
{
int ret;

lock_kernel();
ret = vme_user_ioctl(file->f_path.dentry->d_inode, file, cmd, arg);
unlock_kernel();

return ret;
}


/*
* Unallocate a previously allocated buffer
Expand Down

0 comments on commit c633928

Please sign in to comment.