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 <abbo...@mev.co.uk>
---
v2: rebased to current staging-next.
---
 drivers/staging/comedi/comedi_buf.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/comedi/comedi_buf.c 
b/drivers/staging/comedi/comedi_buf.c
index 5be91cd..df4a9c4 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;
-- 
1.9.2

_______________________________________________
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

Reply via email to