[PATCH v2 31/31] staging: comedi: multiq3: pass subdevice to encoder_reset()

H Hartley Sweeten hsweeten at visionengravers.com
Thu Dec 5 20:43:51 UTC 2013


Pass the subdevice pointer to encoder_reset() from the attach instead
of accessing the dev->subdevices array directly to get the pointer.

Signed-off-by: H Hartley Sweeten <hsweeten at visionengravers.com>
Cc: Ian Abbott <abbotti at mev.co.uk>
Cc: Greg Kroah-Hartman <gregkh at linuxfoundation.org>
---
 drivers/staging/comedi/drivers/multiq3.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/comedi/drivers/multiq3.c b/drivers/staging/comedi/drivers/multiq3.c
index 3ca755e..81e6559 100644
--- a/drivers/staging/comedi/drivers/multiq3.c
+++ b/drivers/staging/comedi/drivers/multiq3.c
@@ -197,9 +197,9 @@ static int multiq3_encoder_insn_read(struct comedi_device *dev,
 	return n;
 }
 
-static void encoder_reset(struct comedi_device *dev)
+static void encoder_reset(struct comedi_device *dev,
+			  struct comedi_subdevice *s)
 {
-	struct comedi_subdevice *s = &dev->subdevices[4];
 	int chan;
 
 	for (chan = 0; chan < s->n_chan; chan++) {
@@ -282,7 +282,7 @@ static int multiq3_attach(struct comedi_device *dev,
 	s->maxdata = 0xffffff;
 	s->range_table = &range_unknown;
 
-	encoder_reset(dev);
+	encoder_reset(dev, s);
 
 	return 0;
 }
-- 
1.8.4.4



More information about the devel mailing list