提交 35d10629 编写于 作者: H H Hartley Sweeten 提交者: Greg Kroah-Hartman

staging: comedi: das16: remove subdevice pointer math

Convert the comedi_subdevice access from pointer math to array
access.
Signed-off-by: NH Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 2add117c
...@@ -1268,7 +1268,7 @@ static int das16_attach(struct comedi_device *dev, struct comedi_devconfig *it) ...@@ -1268,7 +1268,7 @@ static int das16_attach(struct comedi_device *dev, struct comedi_devconfig *it)
if (ret) if (ret)
return ret; return ret;
s = dev->subdevices + 0; s = &dev->subdevices[0];
dev->read_subdev = s; dev->read_subdev = s;
/* ai */ /* ai */
if (board->ai) { if (board->ai) {
...@@ -1300,7 +1300,7 @@ static int das16_attach(struct comedi_device *dev, struct comedi_devconfig *it) ...@@ -1300,7 +1300,7 @@ static int das16_attach(struct comedi_device *dev, struct comedi_devconfig *it)
s->type = COMEDI_SUBD_UNUSED; s->type = COMEDI_SUBD_UNUSED;
} }
s = dev->subdevices + 1; s = &dev->subdevices[1];
/* ao */ /* ao */
if (board->ao) { if (board->ao) {
s->type = COMEDI_SUBD_AO; s->type = COMEDI_SUBD_AO;
...@@ -1318,7 +1318,7 @@ static int das16_attach(struct comedi_device *dev, struct comedi_devconfig *it) ...@@ -1318,7 +1318,7 @@ static int das16_attach(struct comedi_device *dev, struct comedi_devconfig *it)
s->type = COMEDI_SUBD_UNUSED; s->type = COMEDI_SUBD_UNUSED;
} }
s = dev->subdevices + 2; s = &dev->subdevices[2];
/* di */ /* di */
if (board->di) { if (board->di) {
s->type = COMEDI_SUBD_DI; s->type = COMEDI_SUBD_DI;
...@@ -1331,7 +1331,7 @@ static int das16_attach(struct comedi_device *dev, struct comedi_devconfig *it) ...@@ -1331,7 +1331,7 @@ static int das16_attach(struct comedi_device *dev, struct comedi_devconfig *it)
s->type = COMEDI_SUBD_UNUSED; s->type = COMEDI_SUBD_UNUSED;
} }
s = dev->subdevices + 3; s = &dev->subdevices[3];
/* do */ /* do */
if (board->do_) { if (board->do_) {
s->type = COMEDI_SUBD_DO; s->type = COMEDI_SUBD_DO;
...@@ -1346,7 +1346,7 @@ static int das16_attach(struct comedi_device *dev, struct comedi_devconfig *it) ...@@ -1346,7 +1346,7 @@ static int das16_attach(struct comedi_device *dev, struct comedi_devconfig *it)
s->type = COMEDI_SUBD_UNUSED; s->type = COMEDI_SUBD_UNUSED;
} }
s = dev->subdevices + 4; s = &dev->subdevices[4];
/* 8255 */ /* 8255 */
if (board->i8255_offset != 0) { if (board->i8255_offset != 0) {
subdev_8255_init(dev, s, NULL, (dev->iobase + subdev_8255_init(dev, s, NULL, (dev->iobase +
...@@ -1376,7 +1376,7 @@ static void das16_detach(struct comedi_device *dev) ...@@ -1376,7 +1376,7 @@ static void das16_detach(struct comedi_device *dev)
das16_reset(dev); das16_reset(dev);
if (dev->subdevices) if (dev->subdevices)
subdev_8255_cleanup(dev, dev->subdevices + 4); subdev_8255_cleanup(dev, &dev->subdevices[4]);
if (devpriv) { if (devpriv) {
int i; int i;
for (i = 0; i < 2; i++) { for (i = 0; i < 2; i++) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册