staging: comedi: comedi_parport: 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
379585ab5c
commit
9da5ae29cd
1 changed files with 5 additions and 5 deletions
|
@ -277,7 +277,7 @@ static irqreturn_t parport_interrupt(int irq, void *d)
|
||||||
{
|
{
|
||||||
struct comedi_device *dev = d;
|
struct comedi_device *dev = d;
|
||||||
struct parport_private *devpriv = dev->private;
|
struct parport_private *devpriv = dev->private;
|
||||||
struct comedi_subdevice *s = dev->subdevices + 3;
|
struct comedi_subdevice *s = &dev->subdevices[3];
|
||||||
|
|
||||||
if (!devpriv->enable_irq)
|
if (!devpriv->enable_irq)
|
||||||
return IRQ_NONE;
|
return IRQ_NONE;
|
||||||
|
@ -327,7 +327,7 @@ static int parport_attach(struct comedi_device *dev,
|
||||||
return ret;
|
return ret;
|
||||||
devpriv = dev->private;
|
devpriv = dev->private;
|
||||||
|
|
||||||
s = dev->subdevices + 0;
|
s = &dev->subdevices[0];
|
||||||
s->type = COMEDI_SUBD_DIO;
|
s->type = COMEDI_SUBD_DIO;
|
||||||
s->subdev_flags = SDF_READABLE | SDF_WRITABLE;
|
s->subdev_flags = SDF_READABLE | SDF_WRITABLE;
|
||||||
s->n_chan = 8;
|
s->n_chan = 8;
|
||||||
|
@ -336,7 +336,7 @@ static int parport_attach(struct comedi_device *dev,
|
||||||
s->insn_bits = parport_insn_a;
|
s->insn_bits = parport_insn_a;
|
||||||
s->insn_config = parport_insn_config_a;
|
s->insn_config = parport_insn_config_a;
|
||||||
|
|
||||||
s = dev->subdevices + 1;
|
s = &dev->subdevices[1];
|
||||||
s->type = COMEDI_SUBD_DI;
|
s->type = COMEDI_SUBD_DI;
|
||||||
s->subdev_flags = SDF_READABLE;
|
s->subdev_flags = SDF_READABLE;
|
||||||
s->n_chan = 5;
|
s->n_chan = 5;
|
||||||
|
@ -344,7 +344,7 @@ static int parport_attach(struct comedi_device *dev,
|
||||||
s->range_table = &range_digital;
|
s->range_table = &range_digital;
|
||||||
s->insn_bits = parport_insn_b;
|
s->insn_bits = parport_insn_b;
|
||||||
|
|
||||||
s = dev->subdevices + 2;
|
s = &dev->subdevices[2];
|
||||||
s->type = COMEDI_SUBD_DO;
|
s->type = COMEDI_SUBD_DO;
|
||||||
s->subdev_flags = SDF_WRITABLE;
|
s->subdev_flags = SDF_WRITABLE;
|
||||||
s->n_chan = 4;
|
s->n_chan = 4;
|
||||||
|
@ -352,7 +352,7 @@ static int parport_attach(struct comedi_device *dev,
|
||||||
s->range_table = &range_digital;
|
s->range_table = &range_digital;
|
||||||
s->insn_bits = parport_insn_c;
|
s->insn_bits = parport_insn_c;
|
||||||
|
|
||||||
s = dev->subdevices + 3;
|
s = &dev->subdevices[3];
|
||||||
if (irq) {
|
if (irq) {
|
||||||
dev->read_subdev = s;
|
dev->read_subdev = s;
|
||||||
s->type = COMEDI_SUBD_DI;
|
s->type = COMEDI_SUBD_DI;
|
||||||
|
|
Loading…
Add table
Reference in a new issue