[PATCH 01/11] staging: comedi: amplc_pc263: Correct initial state

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

 



The initial state of the relays is being read incorrectly.  It's reading
a single 8-bit port twice, but should be reading two consecutive 8-bit
ports.  Fix it.

Signed-off-by: Ian Abbott <abbotti@xxxxxxxxx>
---
 drivers/staging/comedi/drivers/amplc_pc263.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/comedi/drivers/amplc_pc263.c b/drivers/staging/comedi/drivers/amplc_pc263.c
index 974d745..75a3cd1 100644
--- a/drivers/staging/comedi/drivers/amplc_pc263.c
+++ b/drivers/staging/comedi/drivers/amplc_pc263.c
@@ -332,8 +332,7 @@ static int pc263_attach(struct comedi_device *dev, struct comedi_devconfig *it)
 	/* all outputs */
 	s->io_bits = 0xffff;
 	/* read initial relay state */
-	s->state = inb(dev->iobase);
-	s->state = s->state | (inb(dev->iobase) << 8);
+	s->state = inb(dev->iobase) | (inb(dev->iobase + 1) << 8);
 
 	printk(KERN_INFO "comedi%d: %s ", dev->minor, dev->board_name);
 	switch (thisboard->bustype) {
-- 
1.7.8.6

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/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