summaryrefslogtreecommitdiff
path: root/drivers/staging/comedi/comedidev.h
diff options
context:
space:
mode:
authorH Hartley Sweeten <hsweeten@visionengravers.com>2012-12-19 17:27:02 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-01-07 14:28:19 -0800
commit90a35c15c5d7d5c6254772d2752975dda185710c (patch)
tree7f240eb4dcd4d9f90e047a75515b7c8d50ca619d /drivers/staging/comedi/comedidev.h
parent71cf6d3ee9351d668e9374d4026bf3337540eb22 (diff)
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>
Diffstat (limited to 'drivers/staging/comedi/comedidev.h')
-rw-r--r--drivers/staging/comedi/comedidev.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/staging/comedi/comedidev.h b/drivers/staging/comedi/comedidev.h
index 5127dc28d6f6..259996483c66 100644
--- a/drivers/staging/comedi/comedidev.h
+++ b/drivers/staging/comedi/comedidev.h
@@ -77,6 +77,7 @@
struct comedi_subdevice {
struct comedi_device *device;
+ int index;
int type;
int n_chan;
int subdev_flags;