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 *
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)
{
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;
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)
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;
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;