]> git.openfabrics.org - ~shefty/rdma-dev.git/commit
staging: comedi: adl_pci8164: simplify (*insn_{read,write})
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Wed, 6 Mar 2013 22:58:28 +0000 (15:58 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 11 Mar 2013 17:10:16 +0000 (10:10 -0700)
commita6c57d2ed7ac6224ef70cc5d8adaf9ab8996736c
tree5fc07aea5d01db7dd67a509c1e54803ee7d08d5e
parentd99fc2c3723e50c020bc1ca20107ecbf74d02e1f
staging: comedi: adl_pci8164: simplify (*insn_{read,write})

The (*insn_read) and (*insn_write) functions for all the subdevices
in this driver are the same except for the 'offset' that is added
to the iobase and channel to read/write a register on the board.

Pass the 'offset' in s->private so we can use the same (*insn_read)
and (*insn->write) functions for all the subdevices.

Also, fix the (*insn_read) and (*insn_write) functions so they work
correctly. The comedi core expects them to read/write insn->n data
values and then return the number of values used.

For aesthetic reasons, add some whitespace to the subdevice init.

Remove the dev_info() noise at the end of the attach.

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