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

staging: comedi: addi_apci_1032: only allocate one subdevice

There is only one subdevice used in the driver. Remove the unused
subdevice init and only allcoate space for the one used.
Signed-off-by: default avatarH Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent a3de4cd3
...@@ -40,7 +40,7 @@ static int apci1032_attach_pci(struct comedi_device *dev, ...@@ -40,7 +40,7 @@ static int apci1032_attach_pci(struct comedi_device *dev,
{ {
struct addi_private *devpriv; struct addi_private *devpriv;
struct comedi_subdevice *s; struct comedi_subdevice *s;
int ret, n_subdevices; int ret;
dev->board_name = dev->driver->driver_name; dev->board_name = dev->driver->driver_name;
...@@ -62,21 +62,12 @@ static int apci1032_attach_pci(struct comedi_device *dev, ...@@ -62,21 +62,12 @@ static int apci1032_attach_pci(struct comedi_device *dev,
dev->irq = pcidev->irq; dev->irq = pcidev->irq;
} }
n_subdevices = 7; ret = comedi_alloc_subdevices(dev, 1);
ret = comedi_alloc_subdevices(dev, n_subdevices);
if (ret) if (ret)
return ret; return ret;
/* Allocate and Initialise AI Subdevice Structures */
s = &dev->subdevices[0];
s->type = COMEDI_SUBD_UNUSED;
/* Allocate and Initialise AO Subdevice Structures */
s = &dev->subdevices[1];
s->type = COMEDI_SUBD_UNUSED;
/* Allocate and Initialise DI Subdevice Structures */ /* Allocate and Initialise DI Subdevice Structures */
s = &dev->subdevices[2]; s = &dev->subdevices[0];
s->type = COMEDI_SUBD_DI; s->type = COMEDI_SUBD_DI;
s->subdev_flags = SDF_READABLE; s->subdev_flags = SDF_READABLE;
s->n_chan = 32; s->n_chan = 32;
...@@ -86,22 +77,6 @@ static int apci1032_attach_pci(struct comedi_device *dev, ...@@ -86,22 +77,6 @@ static int apci1032_attach_pci(struct comedi_device *dev,
s->insn_config = i_APCI1032_ConfigDigitalInput; s->insn_config = i_APCI1032_ConfigDigitalInput;
s->insn_bits = apci1032_di_insn_bits; s->insn_bits = apci1032_di_insn_bits;
/* Allocate and Initialise DO Subdevice Structures */
s = &dev->subdevices[3];
s->type = COMEDI_SUBD_UNUSED;
/* Allocate and Initialise Timer Subdevice Structures */
s = &dev->subdevices[4];
s->type = COMEDI_SUBD_UNUSED;
/* Allocate and Initialise TTL */
s = &dev->subdevices[5];
s->type = COMEDI_SUBD_UNUSED;
/* EEPROM */
s = &dev->subdevices[6];
s->type = COMEDI_SUBD_UNUSED;
apci1032_reset(dev); apci1032_reset(dev);
return 0; return 0;
} }
......
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