staging: comedi: usbduxsigma: cleanup the private data 'outBuffer'
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Thu, 23 May 2013 20:04:53 +0000 (13:04 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 30 May 2013 11:41:07 +0000 (20:41 +0900)
commit44d3fcaece73f8a60369cb609f4b81a2270c8e0c
treef9a328b44be27efa9825c90467b1201f5dd59b81
parent2dd87acb1a38a317320be75ca49f53491fa6f577
staging: comedi: usbduxsigma: cleanup the private data 'outBuffer'

This buffer is used to cache the analog output values that are written
to the analog output channels. Currently it only caches the single
writes to the channels using the (*insn_write) callback. The async
command writes are not cached. The buffer is also being kzalloc'ed
during the attach of the driver to a size much larger that required.

Rename the CamelCase buffer and change it to an array in the private
data of the correct size to cache the analog output channel values.

Modify the analog output urb callback so it updates the cached values
with those used for the asynchronous command to allow readback after
the command completes.

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