summaryrefslogtreecommitdiff
path: root/drivers/staging/comedi/drivers/amplc_dio200_common.c
diff options
context:
space:
mode:
authorIan Abbott <abbotti@mev.co.uk>2014-05-01 17:38:24 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-05-03 20:08:57 -0400
commit6e2954e801d7d93fe6f54eff988ddf25836fee0a (patch)
tree60f26347a76e5238c0113960c24917a7ae993f8c /drivers/staging/comedi/drivers/amplc_dio200_common.c
parent7d52477ef5e66a43fe54e5737179e4e670db260d (diff)
staging: comedi: amplc_dio200_common: correct bound on counter mode
For the mode configured by the `INSN_CONFIG_SET_COUNTER_MODE` comedi instruction for the counter subdevice channels supported by this module, the upper bound should be `I8254_MODE5 | I8254_BCD` ((5 << 1) | 1) rather than `I8254_MODE5 | I8254_BINARY` ((5 << 1) | 0). Fix it. Reported-by: Hartley Sweeten <HartleyS@visionengravers.com> 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>
Diffstat (limited to 'drivers/staging/comedi/drivers/amplc_dio200_common.c')
-rw-r--r--drivers/staging/comedi/drivers/amplc_dio200_common.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/staging/comedi/drivers/amplc_dio200_common.c b/drivers/staging/comedi/drivers/amplc_dio200_common.c
index 4ac320884ac6..ee18537b5a92 100644
--- a/drivers/staging/comedi/drivers/amplc_dio200_common.c
+++ b/drivers/staging/comedi/drivers/amplc_dio200_common.c
@@ -820,7 +820,7 @@ dio200_subdev_8254_config(struct comedi_device *dev, struct comedi_subdevice *s,
spin_lock_irqsave(&subpriv->spinlock, flags);
switch (data[0]) {
case INSN_CONFIG_SET_COUNTER_MODE:
- if (data[1] > (I8254_MODE5 | I8254_BINARY))
+ if (data[1] > (I8254_MODE5 | I8254_BCD))
ret = -EINVAL;
else
dio200_subdev_8254_set_mode(dev, s, chan, data[1]);