From a998a3db530bff8094476e82e28c801b09f7aa9e Mon Sep 17 00:00:00 2001 From: H Hartley Sweeten Date: Thu, 25 Jul 2013 16:10:07 -0700 Subject: [PATCH] staging: comedi: usbdux: cleanup the private data 'outBuffer' This buffer is used to cache the 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. The sanity check of the index to dac_commands[] (i.e. the 'chan' being written) is not needed. The chanlist_len will always be less than the number of channels. Also, fix the dev_err() message so it uses the proper device pointer. Signed-off-by: H Hartley Sweeten Reviewed-by: Ian Abbott Signed-off-by: Greg Kroah-Hartman --- Reading git-format-patch failed