From: H Hartley Sweeten <hsweeten@visionengravers.com>
Date: Tue, 14 Oct 2014 17:44:26 +0000 (-0700)
Subject: staging: comedi: addi_apci_035: remove unused subdevices
X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=a6b5d2a272f7cecec3f01f0049bd26ccb61a6d23;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git

staging: comedi: addi_apci_035: remove unused subdevices

Only allocate space for the subdevicess used by the driver. Remove all
the COMEDI_SUBD_UNUSED subdevices.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---

diff --git a/drivers/staging/comedi/drivers/addi_apci_035.c b/drivers/staging/comedi/drivers/addi_apci_035.c
index f2cc95aaa8a2..3eeb244ef855 100644
--- a/drivers/staging/comedi/drivers/addi_apci_035.c
+++ b/drivers/staging/comedi/drivers/addi_apci_035.c
@@ -117,7 +117,7 @@ static int apci035_auto_attach(struct comedi_device *dev,
 		addi_eeprom_read_info(dev, pci_resource_start(pcidev, 0));
 	}
 
-	ret = comedi_alloc_subdevices(dev, 7);
+	ret = comedi_alloc_subdevices(dev, 3);
 	if (ret)
 		return ret;
 
@@ -143,20 +143,8 @@ static int apci035_auto_attach(struct comedi_device *dev,
 		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->type = COMEDI_SUBD_UNUSED;
-
-	/*  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 = &dev->subdevices[1];
 	if (devpriv->s_EeParameters.i_Timer) {
 		s->type = COMEDI_SUBD_TIMER;
 		s->subdev_flags = SDF_WRITEABLE | SDF_GROUND | SDF_COMMON;
@@ -171,12 +159,8 @@ static int apci035_auto_attach(struct comedi_device *dev,
 		s->type = COMEDI_SUBD_UNUSED;
 	}
 
-	/*  Allocate and Initialise TTL */
-	s = &dev->subdevices[5];
-	s->type = COMEDI_SUBD_UNUSED;
-
 	/* EEPROM */
-	s = &dev->subdevices[6];
+	s = &dev->subdevices[2];
 	if (this_board->i_PCIEeprom) {
 		s->type = COMEDI_SUBD_MEMORY;
 		s->subdev_flags = SDF_READABLE | SDF_INTERNAL;