amplc_pc263: Correct initial state
authorIan Abbott <abbotti@mev.co.uk>
Tue, 29 May 2012 14:51:41 +0000 (15:51 +0100)
committerIan Abbott <abbotti@mev.co.uk>
Tue, 29 May 2012 14:51:41 +0000 (15:51 +0100)
The initial state of the relays is being read incorrectly.  Fix it.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
comedi/drivers/amplc_pc263.c

index 75746ad21813b3e533cb11d17e5c7dc637110638..2b907535b33ab32b5fe605657a6266f786b0e9ee 100644 (file)
@@ -312,8 +312,7 @@ static int pc263_attach(comedi_device * dev, 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);
        if (thisboard->bustype == isa_bustype) {