diff options
author | Ian Abbott <abbotti@mev.co.uk> | 2014-05-06 12:12:06 (GMT) |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-05-23 12:25:48 (GMT) |
commit | 0f1f34e844a24187270315ffb539d4bd1900c333 (patch) | |
tree | b49f66ef0a98548b0f182951e1d4515fa17f408a /drivers/staging/comedi/comedi_buf.c | |
parent | 940dd35d5812ead0b93f3f2a1f44732ac069000b (diff) | |
download | linux-0f1f34e844a24187270315ffb539d4bd1900c333.tar.xz |
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_buf.c')
-rw-r--r-- | drivers/staging/comedi/comedi_buf.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/staging/comedi/comedi_buf.c b/drivers/staging/comedi/comedi_buf.c index 2208168..ac498e0 100644 --- a/drivers/staging/comedi/comedi_buf.c +++ b/drivers/staging/comedi/comedi_buf.c @@ -323,8 +323,10 @@ static unsigned int comedi_buf_munge(struct comedi_async *async, return count; } -unsigned int comedi_buf_write_n_allocated(struct comedi_async *async) +unsigned int comedi_buf_write_n_allocated(struct comedi_subdevice *s) { + struct comedi_async *async = s->async; + return async->buf_write_alloc_count - async->buf_write_count; } @@ -333,7 +335,7 @@ unsigned int comedi_buf_write_free(struct comedi_subdevice *s, unsigned int nbytes) { struct comedi_async *async = s->async; - unsigned int allocated = comedi_buf_write_n_allocated(async); + unsigned int allocated = comedi_buf_write_n_allocated(s); if (nbytes > allocated) nbytes = allocated; |