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:13 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-05-23 21:25:50 +0900
commit8ab4fe7e13989ef5b11bd96f1ed6763eabb1d17d (patch)
tree3503dd51913326e79f9d370d0de77425af886fc5 /drivers/staging/comedi/comedi_buf.c
parent5b108588ba1ff6c18502dc9fe711b0229a18b9f8 (diff)
staging: comedi: pass subdevice to __comedi_buf_write_alloc()
Local function `__comedi_buf_write_alloc()` is called by `comedi_buf_write_alloc()` and `comedi_buf_put()`. It 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 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.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/staging/comedi/comedi_buf.c b/drivers/staging/comedi/comedi_buf.c
index b5e329e1f623..5be91cd88cc3 100644
--- a/drivers/staging/comedi/comedi_buf.c
+++ b/drivers/staging/comedi/comedi_buf.c
@@ -250,10 +250,11 @@ static unsigned int comedi_buf_write_n_available(struct comedi_async *async)
return free_end - async->buf_write_alloc_count;
}
-static unsigned int __comedi_buf_write_alloc(struct comedi_async *async,
+static unsigned int __comedi_buf_write_alloc(struct comedi_subdevice *s,
unsigned int nbytes,
int strict)
{
+ struct comedi_async *async = s->async;
unsigned int available = comedi_buf_write_n_available(async);
if (nbytes > available)
@@ -274,7 +275,7 @@ static unsigned int __comedi_buf_write_alloc(struct comedi_async *async,
unsigned int comedi_buf_write_alloc(struct comedi_subdevice *s,
unsigned int nbytes)
{
- return __comedi_buf_write_alloc(s->async, nbytes, 0);
+ return __comedi_buf_write_alloc(s, nbytes, 0);
}
EXPORT_SYMBOL_GPL(comedi_buf_write_alloc);
@@ -427,7 +428,7 @@ EXPORT_SYMBOL_GPL(comedi_buf_read_free);
int comedi_buf_put(struct comedi_subdevice *s, unsigned short x)
{
struct comedi_async *async = s->async;
- unsigned int n = __comedi_buf_write_alloc(async, sizeof(short), 1);
+ unsigned int n = __comedi_buf_write_alloc(s, sizeof(short), 1);
if (n < sizeof(short)) {
async->events |= COMEDI_CB_ERROR;