staging: comedi: store the 'index' for each subdevice
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Thu, 20 Dec 2012 00:27:02 +0000 (17:27 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 7 Jan 2013 22:28:19 +0000 (14:28 -0800)
commit90a35c15c5d7d5c6254772d2752975dda185710c
tree7f240eb4dcd4d9f90e047a75515b7c8d50ca619d
parent71cf6d3ee9351d668e9374d4026bf3337540eb22
staging: comedi: store the 'index' for each subdevice

Store the 'index' for each comedi_subdevice when they are initially
allocated by comedi_alloc_subdevice(). This allows removing the
pointer math in comedi_fops.c which is used to figure out the
index that user space uses to access the individual subdevices.

Fix the ni_mio_common driver so it also uses the 'index' instead
of doing the pointer math.

Also, remove a couple unused macros in the pcmda12, pcmmio, and
pcmuio drivers which also do the pointer math to figure out the
index.

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/comedi_fops.c
drivers/staging/comedi/comedidev.h
drivers/staging/comedi/drivers.c
drivers/staging/comedi/drivers/ni_mio_common.c
drivers/staging/comedi/drivers/pcmda12.c
drivers/staging/comedi/drivers/pcmmio.c
drivers/staging/comedi/drivers/pcmuio.c