diff options
author | Ian Abbott <abbotti@mev.co.uk> | 2014-05-06 16:12:05 +0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-05-23 16:25:48 +0400 |
commit | 940dd35d5812ead0b93f3f2a1f44732ac069000b (patch) | |
tree | fd3aedc855a8dbc15cf1cf7f92e5c4819ffe6051 /drivers/staging/comedi/comedi_buf.c | |
parent | 24e894bbf247ecdeed3ed2f77f658da756760f60 (diff) | |
download | linux-940dd35d5812ead0b93f3f2a1f44732ac069000b.tar.xz |
staging: comedi: pass subdevice to comedi_buf_write_free()
Change the parameters of `comedi_buf_write_free()` 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 | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/staging/comedi/comedi_buf.c b/drivers/staging/comedi/comedi_buf.c index 6a655008655f..220816857128 100644 --- a/drivers/staging/comedi/comedi_buf.c +++ b/drivers/staging/comedi/comedi_buf.c @@ -329,9 +329,10 @@ unsigned int comedi_buf_write_n_allocated(struct comedi_async *async) } /* transfers a chunk from writer to filled buffer space */ -unsigned int comedi_buf_write_free(struct comedi_async *async, +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); if (nbytes > allocated) @@ -426,7 +427,7 @@ int comedi_buf_put(struct comedi_subdevice *s, unsigned short x) return 0; } *(unsigned short *)(async->prealloc_buf + async->buf_write_ptr) = x; - comedi_buf_write_free(async, sizeof(short)); + comedi_buf_write_free(s, sizeof(short)); return 1; } EXPORT_SYMBOL_GPL(comedi_buf_put); |