staging: comedi: ni_tio: remove BUG() checks for ni_tio_get_gate_src()
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Wed, 23 Mar 2016 22:37:01 +0000 (15:37 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 28 Mar 2016 14:30:36 +0000 (07:30 -0700)
commit475ea1ed14cce2608ed0f12474be2a3d75880eaf
tree53406fb21ef349720c87e31b11081826fe60a62a
parentd87f5e90585a8b8646c3e9fe92d4c47716f5e19d
staging: comedi: ni_tio: remove BUG() checks for ni_tio_get_gate_src()

This function calls some helper functions to convert the counter variant
specific gate select bits into the generic enum ni_gpct_clock_source_bits
equivelent. These helper functions currently BUG() if the gate select
bits are invalid.

This should never happen but refactor the code to return -EINVAL instead
and remove the BUG() checks.

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_tio.c