summaryrefslogtreecommitdiffstats
path: root/drivers/staging/comedi/comedi_fops.c
diff options
context:
space:
mode:
authorIan Abbott2014-05-06 14:12:06 +0200
committerGreg Kroah-Hartman2014-05-23 14:25:48 +0200
commit0f1f34e844a24187270315ffb539d4bd1900c333 (patch)
treeb49f66ef0a98548b0f182951e1d4515fa17f408a /drivers/staging/comedi/comedi_fops.c
parentstaging: comedi: pass subdevice to comedi_buf_write_free() (diff)
downloadkernel-qcow2-linux-0f1f34e844a24187270315ffb539d4bd1900c333.tar.gz
kernel-qcow2-linux-0f1f34e844a24187270315ffb539d4bd1900c333.tar.xz
kernel-qcow2-linux-0f1f34e844a24187270315ffb539d4bd1900c333.zip
staging: comedi: pass subdevice to comedi_buf_write_n_allocated()
Change the parameters of `comedi_buf_write_n_allocated()` to pass a pointer to the comedi subdevice instead of a pointer to the "async" structure belonging to the subdevice. The main aim at the moment is to replace all the `struct comedi_async *` parameters with `struct comedi_subdevice *` parameters in the comedi driver API. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/comedi/comedi_fops.c')
-rw-r--r--drivers/staging/comedi/comedi_fops.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/staging/comedi/comedi_fops.c b/drivers/staging/comedi/comedi_fops.c
index c7010b315701..bc9386350b76 100644
--- a/drivers/staging/comedi/comedi_fops.c
+++ b/drivers/staging/comedi/comedi_fops.c
@@ -2040,7 +2040,7 @@ static unsigned int comedi_poll(struct file *file, poll_table *wait)
poll_wait(file, &s->async->wait_head, wait);
comedi_buf_write_alloc(s, s->async->prealloc_bufsz);
if (!s->busy || !comedi_is_subdevice_running(s) ||
- comedi_buf_write_n_allocated(s->async) >= bps)
+ comedi_buf_write_n_allocated(s) >= bps)
mask |= POLLOUT | POLLWRNORM;
}
@@ -2137,8 +2137,8 @@ static ssize_t comedi_write(struct file *file, const char __user *buf,
if (async->buf_write_ptr + m > async->prealloc_bufsz)
m = async->prealloc_bufsz - async->buf_write_ptr;
comedi_buf_write_alloc(s, async->prealloc_bufsz);
- if (m > comedi_buf_write_n_allocated(async))
- m = comedi_buf_write_n_allocated(async);
+ if (m > comedi_buf_write_n_allocated(s))
+ m = comedi_buf_write_n_allocated(s);
if (m < n)
n = m;