staging: comedi: usbdux: tidy up usbdux_ai_insn_read()
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Thu, 25 Jul 2013 23:03:53 +0000 (16:03 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 26 Jul 2013 22:09:54 +0000 (15:09 -0700)
commita79b4cdb52151dab5c5b2a86ab7619bc457470a8
tree4effd0aa5b42b6324bd7c51b7d336a125cb4f198
parent9a79dfce37416c5677512fe5cf7c5a59f8f9b73d
staging: comedi: usbdux: tidy up usbdux_ai_insn_read()

Rename the local variable used for the private data pointer to the
comedi "norm".

Remove the unnecessary sanity check of the private data pointer. This
function can only be called is the private data was allocated during
the attach.

Tidy up the exit path using goto to ensure that the semaphore is
released.

Return -EBUSY instead of 0 if the (*insn_read) cannot be done because
a command is running.

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/usbdux.c