mirror of
https://github.com/FEX-Emu/linux.git
synced 2025-01-06 01:09:08 +00:00
staging: comedi: dt282x: remove subdevice pointer math
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>
This commit is contained in:
parent
d784e4c33f
commit
e1d7cf9c9d
@ -312,7 +312,7 @@ static void dt282x_ao_dma_interrupt(struct comedi_device *dev)
|
|||||||
void *ptr;
|
void *ptr;
|
||||||
int size;
|
int size;
|
||||||
int i;
|
int i;
|
||||||
struct comedi_subdevice *s = dev->subdevices + 1;
|
struct comedi_subdevice *s = &dev->subdevices[1];
|
||||||
|
|
||||||
outw(devpriv->supcsr | DT2821_CLRDMADNE, dev->iobase + DT2821_SUPCSR);
|
outw(devpriv->supcsr | DT2821_CLRDMADNE, dev->iobase + DT2821_SUPCSR);
|
||||||
|
|
||||||
@ -345,7 +345,7 @@ static void dt282x_ai_dma_interrupt(struct comedi_device *dev)
|
|||||||
int size;
|
int size;
|
||||||
int i;
|
int i;
|
||||||
int ret;
|
int ret;
|
||||||
struct comedi_subdevice *s = dev->subdevices;
|
struct comedi_subdevice *s = &dev->subdevices[0];
|
||||||
|
|
||||||
outw(devpriv->supcsr | DT2821_CLRDMADNE, dev->iobase + DT2821_SUPCSR);
|
outw(devpriv->supcsr | DT2821_CLRDMADNE, dev->iobase + DT2821_SUPCSR);
|
||||||
|
|
||||||
@ -457,8 +457,8 @@ static irqreturn_t dt282x_interrupt(int irq, void *d)
|
|||||||
return IRQ_HANDLED;
|
return IRQ_HANDLED;
|
||||||
}
|
}
|
||||||
|
|
||||||
s = dev->subdevices + 0;
|
s = &dev->subdevices[0];
|
||||||
s_ao = dev->subdevices + 1;
|
s_ao = &dev->subdevices[1];
|
||||||
adcsr = inw(dev->iobase + DT2821_ADCSR);
|
adcsr = inw(dev->iobase + DT2821_ADCSR);
|
||||||
dacsr = inw(dev->iobase + DT2821_DACSR);
|
dacsr = inw(dev->iobase + DT2821_DACSR);
|
||||||
supcsr = inw(dev->iobase + DT2821_SUPCSR);
|
supcsr = inw(dev->iobase + DT2821_SUPCSR);
|
||||||
@ -1275,7 +1275,7 @@ static int dt282x_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 subdevice */
|
/* ai subdevice */
|
||||||
@ -1294,7 +1294,7 @@ static int dt282x_attach(struct comedi_device *dev, struct comedi_devconfig *it)
|
|||||||
opt_ai_range_lkup(boardtype.ispgl, it->options[opt_ai_range]);
|
opt_ai_range_lkup(boardtype.ispgl, it->options[opt_ai_range]);
|
||||||
devpriv->ad_2scomp = it->options[opt_ai_twos];
|
devpriv->ad_2scomp = it->options[opt_ai_twos];
|
||||||
|
|
||||||
s++;
|
s = &dev->subdevices[1];
|
||||||
|
|
||||||
s->n_chan = boardtype.dachan;
|
s->n_chan = boardtype.dachan;
|
||||||
if (s->n_chan) {
|
if (s->n_chan) {
|
||||||
@ -1320,7 +1320,7 @@ static int dt282x_attach(struct comedi_device *dev, struct comedi_devconfig *it)
|
|||||||
s->type = COMEDI_SUBD_UNUSED;
|
s->type = COMEDI_SUBD_UNUSED;
|
||||||
}
|
}
|
||||||
|
|
||||||
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;
|
||||||
|
Loading…
Reference in New Issue
Block a user