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>
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]);