Commit 9fab6123 authored by H Hartley Sweeten's avatar H Hartley Sweeten Committed by Greg Kroah-Hartman

staging: comedi: pcl818: remove subdevice pointer math

Convert the comedi_subdevice access from pointer math to array
access.
Signed-off-by: default avatarH Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 9417de06
...@@ -477,7 +477,7 @@ static int pcl818_do_insn_bits(struct comedi_device *dev, ...@@ -477,7 +477,7 @@ static int pcl818_do_insn_bits(struct comedi_device *dev,
static irqreturn_t interrupt_pcl818_ai_mode13_int(int irq, void *d) static irqreturn_t interrupt_pcl818_ai_mode13_int(int irq, void *d)
{ {
struct comedi_device *dev = d; struct comedi_device *dev = d;
struct comedi_subdevice *s = dev->subdevices + 0; struct comedi_subdevice *s = &dev->subdevices[0];
int low; int low;
int timeout = 50; /* wait max 50us */ int timeout = 50; /* wait max 50us */
...@@ -536,7 +536,7 @@ static irqreturn_t interrupt_pcl818_ai_mode13_int(int irq, void *d) ...@@ -536,7 +536,7 @@ static irqreturn_t interrupt_pcl818_ai_mode13_int(int irq, void *d)
static irqreturn_t interrupt_pcl818_ai_mode13_dma(int irq, void *d) static irqreturn_t interrupt_pcl818_ai_mode13_dma(int irq, void *d)
{ {
struct comedi_device *dev = d; struct comedi_device *dev = d;
struct comedi_subdevice *s = dev->subdevices + 0; struct comedi_subdevice *s = &dev->subdevices[0];
int i, len, bufptr; int i, len, bufptr;
unsigned long flags; unsigned long flags;
short *ptr; short *ptr;
...@@ -615,7 +615,7 @@ static irqreturn_t interrupt_pcl818_ai_mode13_dma(int irq, void *d) ...@@ -615,7 +615,7 @@ static irqreturn_t interrupt_pcl818_ai_mode13_dma(int irq, void *d)
static irqreturn_t interrupt_pcl818_ai_mode13_dma_rtc(int irq, void *d) static irqreturn_t interrupt_pcl818_ai_mode13_dma_rtc(int irq, void *d)
{ {
struct comedi_device *dev = d; struct comedi_device *dev = d;
struct comedi_subdevice *s = dev->subdevices + 0; struct comedi_subdevice *s = &dev->subdevices[0];
unsigned long tmp; unsigned long tmp;
unsigned int top1, top2, i, bufptr; unsigned int top1, top2, i, bufptr;
long ofs_dats; long ofs_dats;
...@@ -720,7 +720,7 @@ static irqreturn_t interrupt_pcl818_ai_mode13_dma_rtc(int irq, void *d) ...@@ -720,7 +720,7 @@ static irqreturn_t interrupt_pcl818_ai_mode13_dma_rtc(int irq, void *d)
static irqreturn_t interrupt_pcl818_ai_mode13_fifo(int irq, void *d) static irqreturn_t interrupt_pcl818_ai_mode13_fifo(int irq, void *d)
{ {
struct comedi_device *dev = d; struct comedi_device *dev = d;
struct comedi_subdevice *s = dev->subdevices + 0; struct comedi_subdevice *s = &dev->subdevices[0];
int i, len, lo; int i, len, lo;
outb(0, dev->iobase + PCL818_FI_INTCLR); /* clear fifo int request */ outb(0, dev->iobase + PCL818_FI_INTCLR); /* clear fifo int request */
...@@ -811,7 +811,7 @@ static irqreturn_t interrupt_pcl818(int irq, void *d) ...@@ -811,7 +811,7 @@ static irqreturn_t interrupt_pcl818(int irq, void *d)
being reprogrammed while a DMA transfer is in being reprogrammed while a DMA transfer is in
progress. progress.
*/ */
struct comedi_subdevice *s = dev->subdevices + 0; struct comedi_subdevice *s = &dev->subdevices[0];
devpriv->ai_act_scan = 0; devpriv->ai_act_scan = 0;
devpriv->neverending_ai = 0; devpriv->neverending_ai = 0;
pcl818_ai_cancel(dev, s); pcl818_ai_cancel(dev, s);
...@@ -1763,7 +1763,7 @@ static int pcl818_attach(struct comedi_device *dev, struct comedi_devconfig *it) ...@@ -1763,7 +1763,7 @@ static int pcl818_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];
if (!board->n_aichan_se) { if (!board->n_aichan_se) {
s->type = COMEDI_SUBD_UNUSED; s->type = COMEDI_SUBD_UNUSED;
} else { } else {
...@@ -1829,7 +1829,7 @@ static int pcl818_attach(struct comedi_device *dev, struct comedi_devconfig *it) ...@@ -1829,7 +1829,7 @@ static int pcl818_attach(struct comedi_device *dev, struct comedi_devconfig *it)
} }
} }
s = dev->subdevices + 1; s = &dev->subdevices[1];
if (!board->n_aochan) { if (!board->n_aochan) {
s->type = COMEDI_SUBD_UNUSED; s->type = COMEDI_SUBD_UNUSED;
} else { } else {
...@@ -1862,7 +1862,7 @@ static int pcl818_attach(struct comedi_device *dev, struct comedi_devconfig *it) ...@@ -1862,7 +1862,7 @@ static int pcl818_attach(struct comedi_device *dev, struct comedi_devconfig *it)
} }
} }
s = dev->subdevices + 2; s = &dev->subdevices[2];
if (!board->n_dichan) { if (!board->n_dichan) {
s->type = COMEDI_SUBD_UNUSED; s->type = COMEDI_SUBD_UNUSED;
} else { } else {
...@@ -1875,7 +1875,7 @@ static int pcl818_attach(struct comedi_device *dev, struct comedi_devconfig *it) ...@@ -1875,7 +1875,7 @@ static int pcl818_attach(struct comedi_device *dev, struct comedi_devconfig *it)
s->insn_bits = pcl818_di_insn_bits; s->insn_bits = pcl818_di_insn_bits;
} }
s = dev->subdevices + 3; s = &dev->subdevices[3];
if (!board->n_dochan) { if (!board->n_dochan) {
s->type = COMEDI_SUBD_UNUSED; s->type = COMEDI_SUBD_UNUSED;
} else { } else {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment