summaryrefslogtreecommitdiffstats
path: root/drivers/staging/comedi/comedi_buf.c
diff options
context:
space:
mode:
authorIan Abbott <abbotti@mev.co.uk>2014-05-06 13:12:14 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-05-23 21:25:50 +0900
commita1c0e5fe68b437ba43b3125fbe5d8c72dca242a2 (patch)
tree30b5be04f684c6e409dfbd04934ab564c8462008 /drivers/staging/comedi/comedi_buf.c
parent8ab4fe7e13989ef5b11bd96f1ed6763eabb1d17d (diff)
staging: comedi: pass subdevice to comedi_buf_write_n_available()
Local function `comedi_buf_write_n_available()` currently takes a pointer to a `struct comedi_async`. Change it to take a pointer to a `struct comedi_subdevice` and use the `async` member for consistency with the other comedi buffer handling functions. 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_buf.c')
-rw-r--r--drivers/staging/comedi/comedi_buf.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/staging/comedi/comedi_buf.c b/drivers/staging/comedi/comedi_buf.c
index 5be91cd88cc3..df4a9c4bca35 100644
--- a/drivers/staging/comedi/comedi_buf.c
+++ b/drivers/staging/comedi/comedi_buf.c
@@ -243,8 +243,9 @@ void comedi_buf_reset(struct comedi_subdevice *s)
async->events = 0;
}
-static unsigned int comedi_buf_write_n_available(struct comedi_async *async)
+static unsigned int comedi_buf_write_n_available(struct comedi_subdevice *s)
{
+ struct comedi_async *async = s->async;
unsigned int free_end = async->buf_read_count + async->prealloc_bufsz;
return free_end - async->buf_write_alloc_count;
@@ -255,7 +256,7 @@ static unsigned int __comedi_buf_write_alloc(struct comedi_subdevice *s,
int strict)
{
struct comedi_async *async = s->async;
- unsigned int available = comedi_buf_write_n_available(async);
+ unsigned int available = comedi_buf_write_n_available(s);
if (nbytes > available)
nbytes = strict ? 0 : available;