Commit 3bc3a823 authored by Ian Abbott's avatar Ian Abbott Committed by Greg Kroah-Hartman

staging: comedi: daqboard2000: use type 'u16' for CPLD data and status

The CPLD status and data registers used to load firmware are 16 bits
wide.  Use the type `u16` to represent data and status values instead of
`int`.
Signed-off-by: default avatarIan Abbott <abbotti@mev.co.uk>
Reviewed-by: default avatarH Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 1736bcf3
...@@ -470,11 +470,11 @@ static void daqboard2000_pulse_prog_pin(struct comedi_device *dev) ...@@ -470,11 +470,11 @@ static void daqboard2000_pulse_prog_pin(struct comedi_device *dev)
mdelay(10); /* Not in the original code, but I like symmetry... */ mdelay(10); /* Not in the original code, but I like symmetry... */
} }
static int daqboard2000_poll_cpld(struct comedi_device *dev, int mask) static int daqboard2000_poll_cpld(struct comedi_device *dev, u16 mask)
{ {
int result = 0; int result = 0;
int i; int i;
int cpld; u16 cpld;
/* timeout after 50 tries -> 5ms */ /* timeout after 50 tries -> 5ms */
for (i = 0; i < 50; i++) { for (i = 0; i < 50; i++) {
...@@ -489,7 +489,7 @@ static int daqboard2000_poll_cpld(struct comedi_device *dev, int mask) ...@@ -489,7 +489,7 @@ static int daqboard2000_poll_cpld(struct comedi_device *dev, int mask)
return result; return result;
} }
static int daqboard2000_write_cpld(struct comedi_device *dev, int data) static int daqboard2000_write_cpld(struct comedi_device *dev, u16 data)
{ {
int result = 0; int result = 0;
...@@ -527,7 +527,7 @@ static int daqboard2000_load_firmware(struct comedi_device *dev, ...@@ -527,7 +527,7 @@ static int daqboard2000_load_firmware(struct comedi_device *dev,
break; break;
} }
for (; i < len; i += 2) { for (; i < len; i += 2) {
int data = u16 data =
(cpld_array[i] << 8) + cpld_array[i + 1]; (cpld_array[i] << 8) + cpld_array[i + 1];
if (!daqboard2000_write_cpld(dev, data)) if (!daqboard2000_write_cpld(dev, data))
break; break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment