From: H Hartley Sweeten Date: Thu, 6 Sep 2012 01:39:13 +0000 (-0700) Subject: staging: comedi: dt2801: fix access to 2nd dio subdevice X-Git-Tag: next-20120907~17^2~69 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=52a07cde495ccca9212b3f725b606c75e8d89a2e;p=karo-tx-linux.git staging: comedi: dt2801: fix access to 2nd dio subdevice Only 4 subdevices are allocated by this driver. The 2nd dio subdevice is 'dev->subdevice + 3' not '... + 4'. Signed-off-by: H Hartley Sweeten Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/comedi/drivers/dt2801.c b/drivers/staging/comedi/drivers/dt2801.c index d332269375ab..b6481bc3b2d8 100644 --- a/drivers/staging/comedi/drivers/dt2801.c +++ b/drivers/staging/comedi/drivers/dt2801.c @@ -532,7 +532,7 @@ static int dt2801_dio_insn_bits(struct comedi_device *dev, { int which = 0; - if (s == dev->subdevices + 4) + if (s == dev->subdevices + 3) which = 1; if (data[0]) { @@ -555,7 +555,7 @@ static int dt2801_dio_insn_config(struct comedi_device *dev, { int which = 0; - if (s == dev->subdevices + 4) + if (s == dev->subdevices + 3) which = 1; /* configure */