diff options
author | H Hartley Sweeten <hsweeten@visionengravers.com> | 2014-07-28 10:27:02 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-07-30 16:51:00 -0700 |
commit | 78c7a4a6592cde3e2ecba1732727d3ed3866a653 (patch) | |
tree | 48da886eb1045205fbd4404ae32ff055711bcf78 /drivers/staging/comedi | |
parent | 65dbae525fc1e6b5c2cd09e1fc700a7d80b3577d (diff) | |
download | talos-obmc-linux-78c7a4a6592cde3e2ecba1732727d3ed3866a653.tar.gz talos-obmc-linux-78c7a4a6592cde3e2ecba1732727d3ed3866a653.zip |
staging: comedi: ni_tiocmd: tidy up ni_tio_input_inttrig()
Remove the BUG_ON(counter == NULL). If this can never happen and it
if did the driver should have died long before this function is called.
For aesthetics, rename the local variable 'retval' to simply 'ret'.
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>
Diffstat (limited to 'drivers/staging/comedi')
-rw-r--r-- | drivers/staging/comedi/drivers/ni_tiocmd.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/drivers/staging/comedi/drivers/ni_tiocmd.c b/drivers/staging/comedi/drivers/ni_tiocmd.c index 16858fbd215d..334ce3529e08 100644 --- a/drivers/staging/comedi/drivers/ni_tiocmd.c +++ b/drivers/staging/comedi/drivers/ni_tiocmd.c @@ -92,9 +92,7 @@ static int ni_tio_input_inttrig(struct comedi_device *dev, struct ni_gpct *counter = s->private; struct comedi_cmd *cmd = &s->async->cmd; unsigned long flags; - int retval = 0; - - BUG_ON(counter == NULL); + int ret = 0; if (trig_num != cmd->start_src) return -EINVAL; @@ -103,14 +101,14 @@ static int ni_tio_input_inttrig(struct comedi_device *dev, if (counter->mite_chan) mite_dma_arm(counter->mite_chan); else - retval = -EIO; + ret = -EIO; spin_unlock_irqrestore(&counter->lock, flags); - if (retval < 0) - return retval; - retval = ni_tio_arm(counter, 1, NI_GPCT_ARM_IMMEDIATE); + if (ret < 0) + return ret; + ret = ni_tio_arm(counter, 1, NI_GPCT_ARM_IMMEDIATE); s->async->inttrig = NULL; - return retval; + return ret; } static int ni_tio_input_cmd(struct comedi_subdevice *s) |