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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxxxxxxx>
Cc: Ian Abbott <abbotti@xxxxxxxxx>
Cc: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
---
 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

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel




[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux