staging: comedi: usbdux: fix usbdux_counter_read()
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Thu, 25 Jul 2013 23:06:30 +0000 (16:06 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 26 Jul 2013 22:09:56 +0000 (15:09 -0700)
commit48967d4f5d91acbe0e70fa821c5951059566ac84
treec8496e7b2e8ad51c1035b62bf426b1ffb9c54004
parent81a9bdaac428174d04df8b361c9363a5e33f533f
staging: comedi: usbdux: fix usbdux_counter_read()

Comedi (*insn_read) operations are supposed to read and return insn->n
values. Fix this function to work like the core expects.

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.

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