提交 9263cd67 编写于 作者: H H Hartley Sweeten 提交者: Greg Kroah-Hartman

staging: comedi: dt3000: 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>
上级 e1d7cf9c
...@@ -330,7 +330,7 @@ static irqreturn_t dt3k_interrupt(int irq, void *d) ...@@ -330,7 +330,7 @@ static irqreturn_t dt3k_interrupt(int irq, void *d)
if (!dev->attached) if (!dev->attached)
return IRQ_NONE; return IRQ_NONE;
s = dev->subdevices + 0; s = &dev->subdevices[0];
status = readw(devpriv->io_addr + DPR_Intr_Flag); status = readw(devpriv->io_addr + DPR_Intr_Flag);
#ifdef DEBUG #ifdef DEBUG
debug_intr_flags(status); debug_intr_flags(status);
...@@ -842,7 +842,7 @@ static int dt3000_attach(struct comedi_device *dev, struct comedi_devconfig *it) ...@@ -842,7 +842,7 @@ static int dt3000_attach(struct comedi_device *dev, struct comedi_devconfig *it)
if (ret) if (ret)
return ret; return ret;
s = dev->subdevices; s = &dev->subdevices[0];
dev->read_subdev = s; dev->read_subdev = s;
/* ai subdevice */ /* ai subdevice */
...@@ -857,7 +857,7 @@ static int dt3000_attach(struct comedi_device *dev, struct comedi_devconfig *it) ...@@ -857,7 +857,7 @@ static int dt3000_attach(struct comedi_device *dev, struct comedi_devconfig *it)
s->do_cmdtest = dt3k_ai_cmdtest; s->do_cmdtest = dt3k_ai_cmdtest;
s->cancel = dt3k_ai_cancel; s->cancel = dt3k_ai_cancel;
s++; s = &dev->subdevices[1];
/* ao subsystem */ /* ao subsystem */
s->type = COMEDI_SUBD_AO; s->type = COMEDI_SUBD_AO;
s->subdev_flags = SDF_WRITABLE; s->subdev_flags = SDF_WRITABLE;
...@@ -868,7 +868,7 @@ static int dt3000_attach(struct comedi_device *dev, struct comedi_devconfig *it) ...@@ -868,7 +868,7 @@ static int dt3000_attach(struct comedi_device *dev, struct comedi_devconfig *it)
s->len_chanlist = 1; s->len_chanlist = 1;
s->range_table = &range_bipolar10; s->range_table = &range_bipolar10;
s++; s = &dev->subdevices[2];
/* dio subsystem */ /* dio subsystem */
s->type = COMEDI_SUBD_DIO; s->type = COMEDI_SUBD_DIO;
s->subdev_flags = SDF_READABLE | SDF_WRITABLE; s->subdev_flags = SDF_READABLE | SDF_WRITABLE;
...@@ -879,7 +879,7 @@ static int dt3000_attach(struct comedi_device *dev, struct comedi_devconfig *it) ...@@ -879,7 +879,7 @@ static int dt3000_attach(struct comedi_device *dev, struct comedi_devconfig *it)
s->len_chanlist = 8; s->len_chanlist = 8;
s->range_table = &range_digital; s->range_table = &range_digital;
s++; s = &dev->subdevices[3];
/* mem subsystem */ /* mem subsystem */
s->type = COMEDI_SUBD_MEMORY; s->type = COMEDI_SUBD_MEMORY;
s->subdev_flags = SDF_READABLE; s->subdev_flags = SDF_READABLE;
...@@ -890,7 +890,7 @@ static int dt3000_attach(struct comedi_device *dev, struct comedi_devconfig *it) ...@@ -890,7 +890,7 @@ static int dt3000_attach(struct comedi_device *dev, struct comedi_devconfig *it)
s->range_table = &range_unknown; s->range_table = &range_unknown;
#if 0 #if 0
s++; s = &dev->subdevices[4];
/* proc subsystem */ /* proc subsystem */
s->type = COMEDI_SUBD_PROC; s->type = COMEDI_SUBD_PROC;
#endif #endif
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册