summaryrefslogtreecommitdiff
path: root/drivers/staging/comedi/drivers/addi_apci_1032.c
diff options
context:
space:
mode:
authorH Hartley Sweeten <hartleys@visionengravers.com>2012-11-05 14:40:18 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-11-06 09:30:57 +0100
commitb37f84d56af3efcadd3fc01630f029382707e312 (patch)
treec5e714ba8843c53afffd468bfcce1d3b1931556b /drivers/staging/comedi/drivers/addi_apci_1032.c
parenta3de4cd33c63c256b2521e61e487ae99cf313d94 (diff)
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: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/comedi/drivers/addi_apci_1032.c')
-rw-r--r--drivers/staging/comedi/drivers/addi_apci_1032.c31
1 files changed, 3 insertions, 28 deletions
diff --git a/drivers/staging/comedi/drivers/addi_apci_1032.c b/drivers/staging/comedi/drivers/addi_apci_1032.c
index 9e60d1f30e6d..1b4d6983aa54 100644
--- a/drivers/staging/comedi/drivers/addi_apci_1032.c
+++ b/drivers/staging/comedi/drivers/addi_apci_1032.c
@@ -40,7 +40,7 @@ static int apci1032_attach_pci(struct comedi_device *dev,
{
struct addi_private *devpriv;
struct comedi_subdevice *s;
- int ret, n_subdevices;
+ int ret;
dev->board_name = dev->driver->driver_name;
@@ -62,21 +62,12 @@ static int apci1032_attach_pci(struct comedi_device *dev,
dev->irq = pcidev->irq;
}
- n_subdevices = 7;
- ret = comedi_alloc_subdevices(dev, n_subdevices);
+ ret = comedi_alloc_subdevices(dev, 1);
if (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 */
- s = &dev->subdevices[2];
+ s = &dev->subdevices[0];
s->type = COMEDI_SUBD_DI;
s->subdev_flags = SDF_READABLE;
s->n_chan = 32;
@@ -86,22 +77,6 @@ static int apci1032_attach_pci(struct comedi_device *dev,
s->insn_config = i_APCI1032_ConfigDigitalInput;
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);
return 0;
}