summaryrefslogtreecommitdiff
path: root/drivers/staging/comedi
diff options
context:
space:
mode:
authorIan Abbott <abbotti@mev.co.uk>2013-10-16 14:40:33 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-10-16 12:48:31 -0700
commit5c174c41d8a702ade02fbb125b15f58158e4d1da (patch)
tree3e5deacee9877443f7ea59e15924b10db33b7ece /drivers/staging/comedi
parentf23b65a58888555524851086d0fa418525650c83 (diff)
staging: comedi: pcmuio: sample types are unsigned
Sample values in comedi are generally represented as unsigned values. Change `pcmuio_handle_intr_subdev()` in the "pcmuio" module to use unsigned sample values for consistency. Also, make the order in which `pcmuio_handle_intr_subdev()` writes the two sample values (each actually containing up to 16 1-bit sample values) independent of the host byte ordering. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/comedi')
-rw-r--r--drivers/staging/comedi/drivers/pcmuio.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/staging/comedi/drivers/pcmuio.c b/drivers/staging/comedi/drivers/pcmuio.c
index 67e2bb1d66f0..954fa96a50ac 100644
--- a/drivers/staging/comedi/drivers/pcmuio.c
+++ b/drivers/staging/comedi/drivers/pcmuio.c
@@ -315,8 +315,8 @@ static void pcmuio_handle_intr_subdev(struct comedi_device *dev,
}
/* Write the scan to the buffer. */
- if (comedi_buf_put(s->async, ((short *)&val)[0]) &&
- comedi_buf_put(s->async, ((short *)&val)[1])) {
+ if (comedi_buf_put(s->async, val) &&
+ comedi_buf_put(s->async, val >> 16)) {
s->async->events |= (COMEDI_CB_BLOCK | COMEDI_CB_EOS);
} else {
/* Overflow! Stop acquisition!! */