staging: comedi: daqboard2000: use type 'u16' for CPLD data and status
authorIan Abbott <abbotti@mev.co.uk>
Wed, 4 Jan 2017 10:55:36 +0000 (10:55 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 10 Jan 2017 16:38:32 +0000 (17:38 +0100)
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: 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/drivers/daqboard2000.c

index 954a1a5..e73baba 100644 (file)
@@ -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... */
 }
 
-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 i;
-       int cpld;
+       u16 cpld;
 
        /* timeout after 50 tries -> 5ms */
        for (i = 0; i < 50; i++) {
@@ -489,7 +489,7 @@ static int daqboard2000_poll_cpld(struct comedi_device *dev, int mask)
        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;
 
@@ -527,7 +527,7 @@ static int daqboard2000_load_firmware(struct comedi_device *dev,
                                        break;
                        }
                        for (; i < len; i += 2) {
-                               int data =
+                               u16 data =
                                    (cpld_array[i] << 8) + cpld_array[i + 1];
                                if (!daqboard2000_write_cpld(dev, data))
                                        break;