From: H Hartley Sweeten Date: Wed, 23 Mar 2016 22:37:03 +0000 (-0700) Subject: staging: comedi: ni_tio: remove BUG() in ni_tio_set_gate_src() X-Git-Tag: v4.7-rc1~90^2~550 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=fa74d136fda8512a17918fc5f97a72acd05c22e3;p=karo-tx-linux.git staging: comedi: ni_tio: remove BUG() in ni_tio_set_gate_src() This BUG() can never happen. The previous ni_tio_has_gate2_registers() check will have already caused the function to return -EINVAL. Signed-off-by: H Hartley Sweeten Reviewed-by: Ian Abbott Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/comedi/drivers/ni_tio.c b/drivers/staging/comedi/drivers/ni_tio.c index 10d4585ab25c..9ce3a9a92a9a 100644 --- a/drivers/staging/comedi/drivers/ni_tio.c +++ b/drivers/staging/comedi/drivers/ni_tio.c @@ -1020,8 +1020,7 @@ int ni_tio_set_gate_src(struct ni_gpct *counter, case ni_gpct_variant_660x: return ni_660x_set_gate2(counter, src); default: - BUG(); - break; + return -EINVAL; } break; default: