staging: comedi: usbdux: simplify initializing the ao urb transfer_buffer
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Thu, 25 Jul 2013 23:10:25 +0000 (16:10 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 26 Jul 2013 22:10:08 +0000 (15:10 -0700)
commitc769f85e2740ebe7e4c726632fed52818640faba
treef4fa15a6db1ced4ced4e4d2e416179245e742215
parenta998a3db530bff8094476e82e28c801b09f7aa9e
staging: comedi: usbdux: simplify initializing the ao urb transfer_buffer

Remove the ugly casting of datap to the ao urb->transfer_buffer. The format
of the data in the buffer is simply.

  [0] = # of channels to update (s->async->cmd.chanlist.len)
  [1] = lsb of value for 1st channel to update
  [2] = msb of value for 1st channel to update
  [3] = 1st channel to update (depvriv->dac_commands[0])

If more than 1 channel is to be updated they are simply added to the buffer:

  [4] = lsb of value for 2st channel to update
  [5] = msb of value for 2st channel to update
  [6] = 1st channel to update (depvriv->dac_commands[1])

etc.

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