]> git.baikalelectronics.ru Git - kernel.git/commit
staging: comedi: adl_pci8164: simplify axis register determination
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Wed, 6 Mar 2013 22:57:51 +0000 (15:57 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 11 Mar 2013 17:10:16 +0000 (10:10 -0700)
commitbe2b5b3337e3666df4c5197ed244ccb4391fc2f5
tree3c85bf91df9d55cc080d6934805a33eb0016fe39
parentefb9c752a2dba00a693380035959a1753743620e
staging: comedi: adl_pci8164: simplify axis register determination

The low-level i/o functions in this driver simply read/write a
register based on the channel in insn->chanspec and an offset.

Create a macro, PCI8164_AXIS(), that takes the channel number as
a parameter and returns the register value.

Remove the switch() statements used to figure out the 'axis_reg'
and use the new macro instead.

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