staging: comedi: ni_mio_common: tidy up AO trigger selection
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Thu, 14 Apr 2016 16:58:00 +0000 (09:58 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 29 Apr 2016 05:17:28 +0000 (22:17 -0700)
commit55f9e7d9d35ac681dc899c9874dec35976c27dda
tree12d6f2895ea257d321dabf2fe913e33c941a6698
parent0b235d5ce4e084535e27e0416449d3c3b0d133ea
staging: comedi: ni_mio_common: tidy up AO trigger selection

The AO subdevice (*cancel), ni_ao_reset(), always sets the private
data 'ao_trigger_select' to 0. So when a command is started the
'trigsel' value in ni_ao_cmd_set_trigger() will always start as 0.
Remove the unnecessary member from the private data.

The (*do_cmdtest) validates that the cmd->start_src will only be
TRIG_INT or TRIG_EXT. Refactor ni_ao_cmd_set_trigger() and remove
the BUG() which can never occur.

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/ni_mio_common.c
drivers/staging/comedi/drivers/ni_stc.h