staging: comedi: jr3_pci: tidy up jr3_pci_ai_insn_read()
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Fri, 7 Mar 2014 20:41:03 +0000 (13:41 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 17 Mar 2014 19:38:53 +0000 (12:38 -0700)
commit16a86abea711d9ea5893cd60a6cd608393f9698c
tree91a27b80016378b8521475f46cac26ebd48ac9c9
parent617cd65312a651d20c8c252b1465dfdec1a03ac4
staging: comedi: jr3_pci: tidy up jr3_pci_ai_insn_read()

Refactor this function to make it clearer.

The channel does not need to be validated. The comedi core does that for us.

Exit early if the subdevice private data is invalid.

Exit early if the subdevice 'state' is not done or there is an error.

Factor out the code that actually reads the channel data to reduce the
indent level.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/comedi/drivers/jr3_pci.c