staging: comedi: me4000: remove 'board' from me4000_ai_insn_read()
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Wed, 5 Aug 2015 17:44:42 +0000 (10:44 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 7 Aug 2015 22:03:27 +0000 (15:03 -0700)
commit1a02387063fbd32f51c98540499b90acc8b4317f
tree22d0539b743eb33ed5a01ca82a6572f57dfb4766
parent03611e5491e488f30a5b7653e02ee65032cfba14
staging: comedi: me4000: remove 'board' from me4000_ai_insn_read()

The 'board' pointer is only used in this function to verify that the
'chan' is valid for an aref of AREF_DIFF. For differential inputs, the
maximum channel is half the subdevice 'n_chan'. Use that instead and
remove the 'board' variable.

Also, the comedi core does not validate the aref flags. Add a check
to ensure that the subdevice actually supports the AREF_DIFF mode.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/comedi/drivers/me4000.c