Commit 52a07cde authored by H Hartley Sweeten's avatar H Hartley Sweeten Committed by Greg Kroah-Hartman

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: default avatarH Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 2930d0ba
......@@ -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 */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment