aboutsummaryrefslogtreecommitdiff
path: root/drivers/staging/comedi/comedi_buf.c
diff options
context:
space:
mode:
authorIan Abbott <abbotti@mev.co.uk>2014-05-06 13:12:07 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-05-23 21:25:49 +0900
commitd13be55a37a136ee4274680308b7d0d7e3818bf3 (patch)
tree897c67a32ae2da9614cfe52617bf2c62209171ed /drivers/staging/comedi/comedi_buf.c
parent0f1f34e844a24187270315ffb539d4bd1900c333 (diff)
staging: comedi: pass subdevice to comedi_buf_read_alloc()
Change the parameters of `comedi_buf_read_alloc()` 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.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 ac498e0b4865..07e0b3a51828 100644
--- a/drivers/staging/comedi/comedi_buf.c
+++ b/drivers/staging/comedi/comedi_buf.c
@@ -370,9 +370,10 @@ unsigned int comedi_buf_read_n_available(struct comedi_async *async)
EXPORT_SYMBOL_GPL(comedi_buf_read_n_available);
/* allocates a chunk for the reader from filled (and munged) buffer space */
-unsigned int comedi_buf_read_alloc(struct comedi_async *async,
+unsigned int comedi_buf_read_alloc(struct comedi_subdevice *s,
unsigned int nbytes)
{
+ struct comedi_async *async = s->async;
unsigned int available;
available = async->munge_count - async->buf_read_alloc_count;
@@ -441,7 +442,7 @@ int comedi_buf_get(struct comedi_subdevice *s, unsigned short *x)
if (n < sizeof(short))
return 0;
- comedi_buf_read_alloc(async, sizeof(short));
+ comedi_buf_read_alloc(s, sizeof(short));
*x = *(unsigned short *)(async->prealloc_buf + async->buf_read_ptr);
comedi_buf_read_free(async, sizeof(short));
return 1;