Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 354018
b: refs/heads/master
c: ba1bcf6
h: refs/heads/master
v: v3
  • Loading branch information
Ian Abbott authored and Greg Kroah-Hartman committed Jan 18, 2013
1 parent 3361b78 commit cdbdcfe
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 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: a679f36152dab84e9187572b2a3e193ddd95f58d
refs/heads/master: ba1bcf6f23e192e88b7c07d20d6221a0bcb7929e
22 changes: 12 additions & 10 deletions trunk/drivers/staging/comedi/comedi_fops.c
Original file line number Diff line number Diff line change
Expand Up @@ -103,14 +103,16 @@ static struct comedi_file_info *comedi_file_info_from_minor(unsigned minor)
return info;
}

struct comedi_device *comedi_dev_from_minor(unsigned minor)
static struct comedi_device *
comedi_dev_from_file_info(struct comedi_file_info *info)
{
struct comedi_file_info *info;

info = comedi_file_info_from_minor(minor);

return info ? info->device : NULL;
}

struct comedi_device *comedi_dev_from_minor(unsigned minor)
{
return comedi_dev_from_file_info(comedi_file_info_from_minor(minor));
}
EXPORT_SYMBOL_GPL(comedi_dev_from_minor);

static struct comedi_subdevice *
Expand Down Expand Up @@ -1647,8 +1649,8 @@ static long comedi_unlocked_ioctl(struct file *file, unsigned int cmd,
unsigned long arg)
{
const unsigned minor = iminor(file->f_dentry->d_inode);
struct comedi_device *dev = comedi_dev_from_minor(minor);
struct comedi_file_info *info = comedi_file_info_from_minor(minor);
struct comedi_device *dev = comedi_dev_from_file_info(info);
int rc;

if (!dev)
Expand Down Expand Up @@ -1771,7 +1773,7 @@ static int comedi_mmap(struct file *file, struct vm_area_struct *vma)
{
const unsigned minor = iminor(file->f_dentry->d_inode);
struct comedi_file_info *info = comedi_file_info_from_minor(minor);
struct comedi_device *dev = comedi_dev_from_minor(minor);
struct comedi_device *dev = comedi_dev_from_file_info(info);
struct comedi_subdevice *s;
struct comedi_async *async;
unsigned long start = vma->vm_start;
Expand Down Expand Up @@ -1851,7 +1853,7 @@ static unsigned int comedi_poll(struct file *file, poll_table *wait)
unsigned int mask = 0;
const unsigned minor = iminor(file->f_dentry->d_inode);
struct comedi_file_info *info = comedi_file_info_from_minor(minor);
struct comedi_device *dev = comedi_dev_from_minor(minor);
struct comedi_device *dev = comedi_dev_from_file_info(info);
struct comedi_subdevice *s;

if (!dev)
Expand Down Expand Up @@ -1897,7 +1899,7 @@ static ssize_t comedi_write(struct file *file, const char __user *buf,
DECLARE_WAITQUEUE(wait, current);
const unsigned minor = iminor(file->f_dentry->d_inode);
struct comedi_file_info *info = comedi_file_info_from_minor(minor);
struct comedi_device *dev = comedi_dev_from_minor(minor);
struct comedi_device *dev = comedi_dev_from_file_info(info);

if (!dev)
return -ENODEV;
Expand Down Expand Up @@ -1992,7 +1994,7 @@ static ssize_t comedi_read(struct file *file, char __user *buf, size_t nbytes,
DECLARE_WAITQUEUE(wait, current);
const unsigned minor = iminor(file->f_dentry->d_inode);
struct comedi_file_info *info = comedi_file_info_from_minor(minor);
struct comedi_device *dev = comedi_dev_from_minor(minor);
struct comedi_device *dev = comedi_dev_from_file_info(info);

if (!dev)
return -ENODEV;
Expand Down

0 comments on commit cdbdcfe

Please sign in to comment.