struct device_attribute *attr, char *buf)
{
struct comedi_file_info *info = dev_get_drvdata(csdev);
- struct comedi_subdevice *s = comedi_read_subdevice(info);
+ struct comedi_device *dev;
+ struct comedi_subdevice *s;
unsigned int size = 0;
- mutex_lock(&info->device->mutex);
+ dev = info->device;
+ mutex_lock(&dev->mutex);
+ s = comedi_read_subdevice(info);
if (s && (s->subdev_flags & SDF_CMD_READ) && s->async)
size = s->async->max_bufsize / 1024;
- mutex_unlock(&info->device->mutex);
+ mutex_unlock(&dev->mutex);
return snprintf(buf, PAGE_SIZE, "%i\n", size);
}
const char *buf, size_t count)
{
struct comedi_file_info *info = dev_get_drvdata(csdev);
- struct comedi_subdevice *s = comedi_read_subdevice(info);
+ struct comedi_device *dev;
+ struct comedi_subdevice *s;
unsigned int size;
int err;
return -EINVAL;
size *= 1024;
- mutex_lock(&info->device->mutex);
+ dev = info->device;
+ mutex_lock(&dev->mutex);
+ s = comedi_read_subdevice(info);
if (s && (s->subdev_flags & SDF_CMD_READ) && s->async)
s->async->max_bufsize = size;
else
err = -EINVAL;
- mutex_unlock(&info->device->mutex);
+ mutex_unlock(&dev->mutex);
return err ? err : count;
}
struct device_attribute *attr, char *buf)
{
struct comedi_file_info *info = dev_get_drvdata(csdev);
- struct comedi_subdevice *s = comedi_read_subdevice(info);
+ struct comedi_device *dev;
+ struct comedi_subdevice *s;
unsigned int size = 0;
- mutex_lock(&info->device->mutex);
+ dev = info->device;
+ mutex_lock(&dev->mutex);
+ s = comedi_read_subdevice(info);
if (s && (s->subdev_flags & SDF_CMD_READ) && s->async)
size = s->async->prealloc_bufsz / 1024;
- mutex_unlock(&info->device->mutex);
+ mutex_unlock(&dev->mutex);
return snprintf(buf, PAGE_SIZE, "%i\n", size);
}
const char *buf, size_t count)
{
struct comedi_file_info *info = dev_get_drvdata(csdev);
- struct comedi_subdevice *s = comedi_read_subdevice(info);
+ struct comedi_device *dev;
+ struct comedi_subdevice *s;
unsigned int size;
int err;
return -EINVAL;
size *= 1024;
- mutex_lock(&info->device->mutex);
+ dev = info->device;
+ mutex_lock(&dev->mutex);
+ s = comedi_read_subdevice(info);
if (s && (s->subdev_flags & SDF_CMD_READ) && s->async)
- err = resize_async_buffer(info->device, s, s->async, size);
+ err = resize_async_buffer(dev, s, s->async, size);
else
err = -EINVAL;
- mutex_unlock(&info->device->mutex);
+ mutex_unlock(&dev->mutex);
return err ? err : count;
}
char *buf)
{
struct comedi_file_info *info = dev_get_drvdata(csdev);
- struct comedi_subdevice *s = comedi_write_subdevice(info);
+ struct comedi_device *dev;
+ struct comedi_subdevice *s;
unsigned int size = 0;
- mutex_lock(&info->device->mutex);
+ dev = info->device;
+ mutex_lock(&dev->mutex);
+ s = comedi_write_subdevice(info);
if (s && (s->subdev_flags & SDF_CMD_WRITE) && s->async)
size = s->async->max_bufsize / 1024;
- mutex_unlock(&info->device->mutex);
+ mutex_unlock(&dev->mutex);
return snprintf(buf, PAGE_SIZE, "%i\n", size);
}
const char *buf, size_t count)
{
struct comedi_file_info *info = dev_get_drvdata(csdev);
- struct comedi_subdevice *s = comedi_write_subdevice(info);
+ struct comedi_device *dev;
+ struct comedi_subdevice *s;
unsigned int size;
int err;
return -EINVAL;
size *= 1024;
- mutex_lock(&info->device->mutex);
+ dev = info->device;
+ mutex_lock(&dev->mutex);
+ s = comedi_write_subdevice(info);
if (s && (s->subdev_flags & SDF_CMD_WRITE) && s->async)
s->async->max_bufsize = size;
else
err = -EINVAL;
- mutex_unlock(&info->device->mutex);
+ mutex_unlock(&dev->mutex);
return err ? err : count;
}
struct device_attribute *attr, char *buf)
{
struct comedi_file_info *info = dev_get_drvdata(csdev);
- struct comedi_subdevice *s = comedi_write_subdevice(info);
+ struct comedi_device *dev;
+ struct comedi_subdevice *s;
unsigned int size = 0;
- mutex_lock(&info->device->mutex);
+ dev = info->device;
+ mutex_lock(&dev->mutex);
+ s = comedi_write_subdevice(info);
if (s && (s->subdev_flags & SDF_CMD_WRITE) && s->async)
size = s->async->prealloc_bufsz / 1024;
- mutex_unlock(&info->device->mutex);
+ mutex_unlock(&dev->mutex);
return snprintf(buf, PAGE_SIZE, "%i\n", size);
}
const char *buf, size_t count)
{
struct comedi_file_info *info = dev_get_drvdata(csdev);
- struct comedi_subdevice *s = comedi_write_subdevice(info);
+ struct comedi_device *dev;
+ struct comedi_subdevice *s;
unsigned int size;
int err;
return -EINVAL;
size *= 1024;
- mutex_lock(&info->device->mutex);
+ dev = info->device;
+ mutex_lock(&dev->mutex);
+ s = comedi_write_subdevice(info);
if (s && (s->subdev_flags & SDF_CMD_WRITE) && s->async)
- err = resize_async_buffer(info->device, s, s->async, size);
+ err = resize_async_buffer(dev, s, s->async, size);
else
err = -EINVAL;
- mutex_unlock(&info->device->mutex);
+ mutex_unlock(&dev->mutex);
return err ? err : count;
}