Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 353931
b: refs/heads/master
c: 7d8a256
h: refs/heads/master
i:
  353929: 8eaa9fd
  353927: 5673f4e
v: v3
  • Loading branch information
H Hartley Sweeten authored and Greg Kroah-Hartman committed Jan 7, 2013
1 parent c0041da commit c16a83f
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 21 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: ed69335c727b7a499ac8499d943c6c879c937d69
refs/heads/master: 7d8a25674f8358e09daf4f1ed4e7dd93416f7b5b
38 changes: 18 additions & 20 deletions trunk/drivers/staging/comedi/comedi_fops.c
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ struct comedi_device *comedi_dev_from_minor(unsigned minor)
EXPORT_SYMBOL_GPL(comedi_dev_from_minor);

static struct comedi_subdevice *
comedi_get_read_subdevice(const struct comedi_file_info *info)
comedi_read_subdevice(const struct comedi_file_info *info)
{
if (info->read_subdevice)
return info->read_subdevice;
Expand All @@ -128,7 +128,7 @@ comedi_get_read_subdevice(const struct comedi_file_info *info)
}

static struct comedi_subdevice *
comedi_get_write_subdevice(const struct comedi_file_info *info)
comedi_write_subdevice(const struct comedi_file_info *info)
{
if (info->write_subdevice)
return info->write_subdevice;
Expand Down Expand Up @@ -183,7 +183,7 @@ static ssize_t show_max_read_buffer_kb(struct device *dev,
struct device_attribute *attr, char *buf)
{
struct comedi_file_info *info = dev_get_drvdata(dev);
struct comedi_subdevice *s = comedi_get_read_subdevice(info);
struct comedi_subdevice *s = comedi_read_subdevice(info);
unsigned int size = 0;

mutex_lock(&info->device->mutex);
Expand All @@ -199,7 +199,7 @@ static ssize_t store_max_read_buffer_kb(struct device *dev,
const char *buf, size_t count)
{
struct comedi_file_info *info = dev_get_drvdata(dev);
struct comedi_subdevice *s = comedi_get_read_subdevice(info);
struct comedi_subdevice *s = comedi_read_subdevice(info);
unsigned int size;
int err;

Expand All @@ -224,7 +224,7 @@ static ssize_t show_read_buffer_kb(struct device *dev,
struct device_attribute *attr, char *buf)
{
struct comedi_file_info *info = dev_get_drvdata(dev);
struct comedi_subdevice *s = comedi_get_read_subdevice(info);
struct comedi_subdevice *s = comedi_read_subdevice(info);
unsigned int size = 0;

mutex_lock(&info->device->mutex);
Expand All @@ -240,7 +240,7 @@ static ssize_t store_read_buffer_kb(struct device *dev,
const char *buf, size_t count)
{
struct comedi_file_info *info = dev_get_drvdata(dev);
struct comedi_subdevice *s = comedi_get_read_subdevice(info);
struct comedi_subdevice *s = comedi_read_subdevice(info);
unsigned int size;
int err;

Expand All @@ -266,7 +266,7 @@ static ssize_t show_max_write_buffer_kb(struct device *dev,
char *buf)
{
struct comedi_file_info *info = dev_get_drvdata(dev);
struct comedi_subdevice *s = comedi_get_write_subdevice(info);
struct comedi_subdevice *s = comedi_write_subdevice(info);
unsigned int size = 0;

mutex_lock(&info->device->mutex);
Expand All @@ -282,7 +282,7 @@ static ssize_t store_max_write_buffer_kb(struct device *dev,
const char *buf, size_t count)
{
struct comedi_file_info *info = dev_get_drvdata(dev);
struct comedi_subdevice *s = comedi_get_write_subdevice(info);
struct comedi_subdevice *s = comedi_write_subdevice(info);
unsigned int size;
int err;

Expand All @@ -307,7 +307,7 @@ static ssize_t show_write_buffer_kb(struct device *dev,
struct device_attribute *attr, char *buf)
{
struct comedi_file_info *info = dev_get_drvdata(dev);
struct comedi_subdevice *s = comedi_get_write_subdevice(info);
struct comedi_subdevice *s = comedi_write_subdevice(info);
unsigned int size = 0;

mutex_lock(&info->device->mutex);
Expand All @@ -323,7 +323,7 @@ static ssize_t store_write_buffer_kb(struct device *dev,
const char *buf, size_t count)
{
struct comedi_file_info *info = dev_get_drvdata(dev);
struct comedi_subdevice *s = comedi_get_write_subdevice(info);
struct comedi_subdevice *s = comedi_write_subdevice(info);
unsigned int size;
int err;

Expand Down Expand Up @@ -583,10 +583,8 @@ static int do_devinfo_ioctl(struct comedi_device *dev,
struct comedi_devinfo devinfo;
const unsigned minor = iminor(file->f_dentry->d_inode);
struct comedi_file_info *info = comedi_file_info_from_minor(minor);
struct comedi_subdevice *read_subdev =
comedi_get_read_subdevice(info);
struct comedi_subdevice *write_subdev =
comedi_get_write_subdevice(info);
struct comedi_subdevice *read_subdev = comedi_read_subdevice(info);
struct comedi_subdevice *write_subdev = comedi_write_subdevice(info);

memset(&devinfo, 0, sizeof(devinfo));

Expand Down Expand Up @@ -1766,9 +1764,9 @@ static int comedi_mmap(struct file *file, struct vm_area_struct *vma)
goto done;
}
if (vma->vm_flags & VM_WRITE)
s = comedi_get_write_subdevice(info);
s = comedi_write_subdevice(info);
else
s = comedi_get_read_subdevice(info);
s = comedi_read_subdevice(info);

if (s == NULL) {
retval = -EINVAL;
Expand Down Expand Up @@ -1843,7 +1841,7 @@ static unsigned int comedi_poll(struct file *file, poll_table *wait)
}

mask = 0;
read_subdev = comedi_get_read_subdevice(info);
read_subdev = comedi_read_subdevice(info);
if (read_subdev) {
poll_wait(file, &read_subdev->async->wait_head, wait);
if (!read_subdev->busy
Expand All @@ -1853,7 +1851,7 @@ static unsigned int comedi_poll(struct file *file, poll_table *wait)
mask |= POLLIN | POLLRDNORM;
}
}
write_subdev = comedi_get_write_subdevice(info);
write_subdev = comedi_write_subdevice(info);
if (write_subdev) {
poll_wait(file, &write_subdev->async->wait_head, wait);
comedi_buf_write_alloc(write_subdev->async,
Expand Down Expand Up @@ -1894,7 +1892,7 @@ static ssize_t comedi_write(struct file *file, const char __user *buf,
goto done;
}

s = comedi_get_write_subdevice(info);
s = comedi_write_subdevice(info);
if (s == NULL) {
retval = -EIO;
goto done;
Expand Down Expand Up @@ -2004,7 +2002,7 @@ static ssize_t comedi_read(struct file *file, char __user *buf, size_t nbytes,
goto done;
}

s = comedi_get_read_subdevice(info);
s = comedi_read_subdevice(info);
if (s == NULL) {
retval = -EIO;
goto done;
Expand Down

0 comments on commit c16a83f

Please sign in to comment.