staging: comedi: addi_apci_3501: introduce apci3501_wait_for_dac()
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Wed, 23 Jan 2013 19:44:40 +0000 (12:44 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 25 Jan 2013 20:00:30 +0000 (12:00 -0800)
commit5458f3e7b5a8707a49948857d69b2eb2fa5931ac
tree055072e33cf40c5f5c669cfcddf4e7feb48436d5
parent99c9fa48b6bbc640066c414d6b413a1f1b4aa857
staging: comedi: addi_apci_3501: introduce apci3501_wait_for_dac()

Refactor the code that waits for the DAC to be ready into a helper
function.

A timeout of some sort should be added to this helper so code the
users to expect the error condition. In i_APCI3501_WriteAnalogOutput()
just return the error and don't actually write the new value to the
DAC. In apci3501_reset() output a dev_warn() that the DAC was not
ready.

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/addi-data/hwdrv_apci3501.c
drivers/staging/comedi/drivers/addi_apci_3501.c