Skip to content

Commit

Permalink
staging: comedi: dt2801: fix access to 2nd dio subdevice
Browse files Browse the repository at this point in the history
Only 4 subdevices are allocated by this driver. The 2nd dio
subdevice is 'dev->subdevice + 3' not '... + 4'.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
H Hartley Sweeten authored and Greg Kroah-Hartman committed Sep 6, 2012
1 parent 2930d0b commit 52a07cd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/staging/comedi/drivers/dt2801.c
Original file line number Diff line number Diff line change
Expand Up @@ -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]) {
Expand All @@ -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 */
Expand Down

0 comments on commit 52a07cd

Please sign in to comment.