]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
staging: comedi: pass subdevice to comedi_buf_memcpy_to()
authorIan Abbott <abbotti@mev.co.uk>
Tue, 6 May 2014 12:12:01 +0000 (13:12 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 23 May 2014 12:25:48 +0000 (21:25 +0900)
Change the parameters of `comedi_buf_memcpy_to()` 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>
drivers/staging/comedi/comedi_buf.c
drivers/staging/comedi/comedidev.h
drivers/staging/comedi/drivers/addi-data/hwdrv_apci3200.c
drivers/staging/comedi/drivers/comedi_fc.c

index acb042c3e03469a6f1963bc81ecd464440ce37e7..de850f3fd49d26ccb52aa5e3aa18056fc121676d 100644 (file)
@@ -445,9 +445,10 @@ int comedi_buf_get(struct comedi_subdevice *s, unsigned short *x)
 }
 EXPORT_SYMBOL_GPL(comedi_buf_get);
 
-void comedi_buf_memcpy_to(struct comedi_async *async, unsigned int offset,
+void comedi_buf_memcpy_to(struct comedi_subdevice *s, unsigned int offset,
                          const void *data, unsigned int num_bytes)
 {
+       struct comedi_async *async = s->async;
        unsigned int write_ptr = async->buf_write_ptr + offset;
 
        if (write_ptr >= async->prealloc_bufsz)
index d19a20ca91b705962bc899a126f555ea5b8a30bd..221db717ebc4e2be82335d8312b0e5a523776064 100644 (file)
@@ -346,7 +346,7 @@ unsigned int comedi_buf_read_free(struct comedi_async *, unsigned int);
 int comedi_buf_put(struct comedi_subdevice *s, unsigned short x);
 int comedi_buf_get(struct comedi_subdevice *s, unsigned short *x);
 
-void comedi_buf_memcpy_to(struct comedi_async *async, unsigned int offset,
+void comedi_buf_memcpy_to(struct comedi_subdevice *s, unsigned int offset,
                          const void *source, unsigned int num_bytes);
 void comedi_buf_memcpy_from(struct comedi_async *async, unsigned int offset,
                            void *destination, unsigned int num_bytes);
index 9b8851c7e07214afe62f7ddb3cf6a4ee895f3a57..51095bebc08726c17d16c31cda394068bc85898e 100644 (file)
@@ -2712,7 +2712,7 @@ static int i_APCI3200_InterruptHandleEos(struct comedi_device *dev)
                                s->async->events |= COMEDI_CB_ERROR;
                        }
                        /*  Write all 7 scan values in the comedi buffer */
-                       comedi_buf_memcpy_to(s->async, 0,
+                       comedi_buf_memcpy_to(s, 0,
                                (unsigned int *) s_BoardInfos[dev->minor].
                                ui_ScanValueArray, (7 + 12) * sizeof(unsigned int));
 
index 9d9b1469e89ad1b05e6b5154157ffe2de9d5c7f9..81749a778de015f265b43ccd8cfc3b38dc14aa35 100644 (file)
@@ -74,7 +74,7 @@ unsigned int cfc_write_array_to_buffer(struct comedi_subdevice *s,
                return 0;
        }
 
-       comedi_buf_memcpy_to(async, 0, data, num_bytes);
+       comedi_buf_memcpy_to(s, 0, data, num_bytes);
        comedi_buf_write_free(async, num_bytes);
        cfc_inc_scan_progress(s, num_bytes);
        async->events |= COMEDI_CB_BLOCK;