struct device_attribute *attr, char *buf)
{
unsigned int minor = MINOR(csdev->devt);
- struct comedi_file_info *info;
struct comedi_device *dev;
struct comedi_subdevice *s;
unsigned int size = 0;
- info = comedi_file_info_from_minor(minor);
- if (!info)
+ dev = comedi_dev_from_minor(minor);
+ if (!dev)
return -ENODEV;
- dev = info->device;
mutex_lock(&dev->mutex);
s = comedi_read_subdevice(dev, minor);
if (s && (s->subdev_flags & SDF_CMD_READ) && s->async)
const char *buf, size_t count)
{
unsigned int minor = MINOR(csdev->devt);
- struct comedi_file_info *info;
struct comedi_device *dev;
struct comedi_subdevice *s;
unsigned int size;
return -EINVAL;
size *= 1024;
- info = comedi_file_info_from_minor(minor);
- if (!info)
+ dev = comedi_dev_from_minor(minor);
+ if (!dev)
return -ENODEV;
- dev = info->device;
mutex_lock(&dev->mutex);
s = comedi_read_subdevice(dev, minor);
if (s && (s->subdev_flags & SDF_CMD_READ) && s->async)
struct device_attribute *attr, char *buf)
{
unsigned int minor = MINOR(csdev->devt);
- struct comedi_file_info *info;
struct comedi_device *dev;
struct comedi_subdevice *s;
unsigned int size = 0;
- info = comedi_file_info_from_minor(minor);
- if (!info)
+ dev = comedi_dev_from_minor(minor);
+ if (!dev)
return -ENODEV;
- dev = info->device;
mutex_lock(&dev->mutex);
s = comedi_read_subdevice(dev, minor);
if (s && (s->subdev_flags & SDF_CMD_READ) && s->async)
const char *buf, size_t count)
{
unsigned int minor = MINOR(csdev->devt);
- struct comedi_file_info *info;
struct comedi_device *dev;
struct comedi_subdevice *s;
unsigned int size;
return -EINVAL;
size *= 1024;
- info = comedi_file_info_from_minor(minor);
- if (!info)
+ dev = comedi_dev_from_minor(minor);
+ if (!dev)
return -ENODEV;
- dev = info->device;
mutex_lock(&dev->mutex);
s = comedi_read_subdevice(dev, minor);
if (s && (s->subdev_flags & SDF_CMD_READ) && s->async)
char *buf)
{
unsigned int minor = MINOR(csdev->devt);
- struct comedi_file_info *info;
struct comedi_device *dev;
struct comedi_subdevice *s;
unsigned int size = 0;
- info = comedi_file_info_from_minor(minor);
- if (!info)
+ dev = comedi_dev_from_minor(minor);
+ if (!dev)
return -ENODEV;
- dev = info->device;
mutex_lock(&dev->mutex);
s = comedi_write_subdevice(dev, minor);
if (s && (s->subdev_flags & SDF_CMD_WRITE) && s->async)
const char *buf, size_t count)
{
unsigned int minor = MINOR(csdev->devt);
- struct comedi_file_info *info;
struct comedi_device *dev;
struct comedi_subdevice *s;
unsigned int size;
return -EINVAL;
size *= 1024;
- info = comedi_file_info_from_minor(minor);
- if (!info)
+ dev = comedi_dev_from_minor(minor);
+ if (!dev)
return -ENODEV;
- dev = info->device;
mutex_lock(&dev->mutex);
s = comedi_write_subdevice(dev, minor);
if (s && (s->subdev_flags & SDF_CMD_WRITE) && s->async)
struct device_attribute *attr, char *buf)
{
unsigned int minor = MINOR(csdev->devt);
- struct comedi_file_info *info;
struct comedi_device *dev;
struct comedi_subdevice *s;
unsigned int size = 0;
- info = comedi_file_info_from_minor(minor);
- if (!info)
+ dev = comedi_dev_from_minor(minor);
+ if (!dev)
return -ENODEV;
- dev = info->device;
mutex_lock(&dev->mutex);
s = comedi_write_subdevice(dev, minor);
if (s && (s->subdev_flags & SDF_CMD_WRITE) && s->async)
const char *buf, size_t count)
{
unsigned int minor = MINOR(csdev->devt);
- struct comedi_file_info *info;
struct comedi_device *dev;
struct comedi_subdevice *s;
unsigned int size;
return -EINVAL;
size *= 1024;
- info = comedi_file_info_from_minor(minor);
- if (!info)
+ dev = comedi_dev_from_minor(minor);
+ if (!dev)
return -ENODEV;
- dev = info->device;
mutex_lock(&dev->mutex);
s = comedi_write_subdevice(dev, minor);
if (s && (s->subdev_flags & SDF_CMD_WRITE) && s->async)
unsigned long arg)
{
const unsigned minor = iminor(file_inode(file));
- struct comedi_file_info *info = comedi_file_info_from_minor(minor);
- struct comedi_device *dev = comedi_dev_from_file_info(info);
+ struct comedi_device *dev = comedi_dev_from_minor(minor);
int rc;
if (!dev)
dev->minor >= comedi_num_legacy_minors) {
/* Successfully unconfigured a dynamically
* allocated device. Try and remove it. */
+ struct comedi_file_info *info;
info = comedi_clear_board_minor(dev->minor);
if (info) {
mutex_unlock(&dev->mutex);
static int comedi_mmap(struct file *file, struct vm_area_struct *vma)
{
const unsigned minor = iminor(file_inode(file));
- struct comedi_file_info *info = comedi_file_info_from_minor(minor);
- struct comedi_device *dev = comedi_dev_from_file_info(info);
+ struct comedi_device *dev = comedi_dev_from_minor(minor);
struct comedi_subdevice *s;
struct comedi_async *async;
unsigned long start = vma->vm_start;
{
unsigned int mask = 0;
const unsigned minor = iminor(file_inode(file));
- struct comedi_file_info *info = comedi_file_info_from_minor(minor);
- struct comedi_device *dev = comedi_dev_from_file_info(info);
+ struct comedi_device *dev = comedi_dev_from_minor(minor);
struct comedi_subdevice *s;
if (!dev)
int n, m, count = 0, retval = 0;
DECLARE_WAITQUEUE(wait, current);
const unsigned minor = iminor(file_inode(file));
- struct comedi_file_info *info = comedi_file_info_from_minor(minor);
- struct comedi_device *dev = comedi_dev_from_file_info(info);
+ struct comedi_device *dev = comedi_dev_from_minor(minor);
if (!dev)
return -ENODEV;
int n, m, count = 0, retval = 0;
DECLARE_WAITQUEUE(wait, current);
const unsigned minor = iminor(file_inode(file));
- struct comedi_file_info *info = comedi_file_info_from_minor(minor);
- struct comedi_device *dev = comedi_dev_from_file_info(info);
+ struct comedi_device *dev = comedi_dev_from_minor(minor);
if (!dev)
return -ENODEV;