Skip to content

Commit

Permalink
staging: comedi: ni_670x: remove subdevice pointer math
Browse files Browse the repository at this point in the history
Convert the comedi_subdevice access from pointer math to array
access.

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 41e862f commit fc041c2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/staging/comedi/drivers/ni_670x.c
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ static int ni_670x_attach(struct comedi_device *dev,
if (ret)
return ret;

s = dev->subdevices + 0;
s = &dev->subdevices[0];
/* analog output subdevice */
s->type = COMEDI_SUBD_AO;
s->subdev_flags = SDF_WRITABLE;
Expand All @@ -271,7 +271,7 @@ static int ni_670x_attach(struct comedi_device *dev,
s->insn_write = &ni_670x_ao_winsn;
s->insn_read = &ni_670x_ao_rinsn;

s = dev->subdevices + 1;
s = &dev->subdevices[1];
/* digital i/o subdevice */
s->type = COMEDI_SUBD_DIO;
s->subdev_flags = SDF_READABLE | SDF_WRITABLE;
Expand All @@ -298,7 +298,7 @@ static void ni_670x_detach(struct comedi_device *dev)
struct comedi_subdevice *s;

if (dev->n_subdevices) {
s = dev->subdevices + 0;
s = &dev->subdevices[0];
if (s)
kfree(s->range_table_list);
}
Expand Down

0 comments on commit fc041c2

Please sign in to comment.