]> rtime.felk.cvut.cz Git - linux-imx.git/commit
staging: comedi: s626: simplify dio register access
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Fri, 22 Mar 2013 22:54:20 +0000 (15:54 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 25 Mar 2013 18:44:43 +0000 (11:44 -0700)
commit100b4edcad71cea9cd815c3519bfe2e93811bd44
tree67bd37e2a7a514aaae51832640577052f94ce309
parent1330af4c7deedd0b6d1ba43734d7e4eb1a83a491
staging: comedi: s626: simplify dio register access

This driver has three dio subdevices, each with 16 channels. These
subdevices use hardware registers that are spaced 0x10 bytes apart
for each "group" of 16 channels.

Create new macros to get the correct addresses for each register
based on the dio "group". Use the s->private (void *) to hold the
"group" number to use in the subdevice functions.

This allows removing struct dio_private and all its uses. It also
removes the ugly casts used to get the register address.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/comedi/drivers/s626.c
drivers/staging/comedi/drivers/s626.h