staging: comedi: usbdux: tidy up usbdux_ao_insn_write()
staging: comedi: usbdux: tidy up usbdux_ao_insn_write()

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_write) cannot be done because
a command is running.

Tidy up the for() loop that writes the data. The dux_commands[1] and [4]
can be set outside the loop since they are constant. Use a local pointer
for dux_commands[2] to load the value to write. Only the last value needs
to be cached in the private data for read back.

Signed-off-by: H Hartley Sweeten <382ff55d8e07d1082d179e669636cd1552da4f36@visionengravers.com>
Reviewed-by: Ian Abbott <9e6ba6483b6a3e14d61f7c987e72ecb5b46122d6@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <4645f7897fd33786a2ee1264d590b3c400559d85@linuxfoundation.org>

KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs