Skip to content

Commit

Permalink
staging: comedi: amplc_pc263: Correct initial state
Browse files Browse the repository at this point in the history
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@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Ian Abbott authored and Greg Kroah-Hartman committed Jun 5, 2012
1 parent a46e759 commit 9f98900
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/staging/comedi/drivers/amplc_pc263.c
Original file line number Diff line number Diff line change
Expand Up @@ -330,8 +330,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) {
Expand Down

0 comments on commit 9f98900

Please sign in to comment.