Commit 9417de06 authored by H Hartley Sweeten's avatar H Hartley Sweeten Committed by Greg Kroah-Hartman

staging: comedi: pcl816: 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 93a37955
...@@ -258,7 +258,7 @@ static int pcl816_ai_insn_read(struct comedi_device *dev, ...@@ -258,7 +258,7 @@ static int pcl816_ai_insn_read(struct comedi_device *dev,
static irqreturn_t interrupt_pcl816_ai_mode13_int(int irq, void *d) static irqreturn_t interrupt_pcl816_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, hi; int low, hi;
int timeout = 50; /* wait max 50us */ int timeout = 50; /* wait max 50us */
...@@ -349,7 +349,7 @@ static void transfer_from_dma_buf(struct comedi_device *dev, ...@@ -349,7 +349,7 @@ static void transfer_from_dma_buf(struct comedi_device *dev,
static irqreturn_t interrupt_pcl816_ai_mode13_dma(int irq, void *d) static irqreturn_t interrupt_pcl816_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 len, bufptr, this_dma_buf; int len, bufptr, this_dma_buf;
unsigned long dma_flags; unsigned long dma_flags;
short *ptr; short *ptr;
...@@ -1183,7 +1183,7 @@ static int pcl816_attach(struct comedi_device *dev, struct comedi_devconfig *it) ...@@ -1183,7 +1183,7 @@ static int pcl816_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 > 0) { if (board->n_aichan > 0) {
s->type = COMEDI_SUBD_AI; s->type = COMEDI_SUBD_AI;
devpriv->sub_ai = s; devpriv->sub_ai = s;
......
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