staging: comedi: addi_apci_035: remove unnecessary subdevice initialization
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Tue, 14 Oct 2014 17:44:25 +0000 (10:44 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 29 Oct 2014 07:48:53 +0000 (15:48 +0800)
The subdevices that don't initialize any of the callbacks don't really
exist. Remove the unnecessary initialzation and just set the type to
COMEDI_SUBD_UNUSED.

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>
drivers/staging/comedi/drivers/addi_apci_035.c

index c9cd68cc610149d8f27741cee2db94ceb466d55f..f2cc95aaa8a2f6ddc9786ec4375a64069cd40bfe 100644 (file)
@@ -145,43 +145,15 @@ static int apci035_auto_attach(struct comedi_device *dev,
 
        /*  Allocate and Initialise AO Subdevice Structures */
        s = &dev->subdevices[1];
-       if (devpriv->s_EeParameters.i_NbrAoChannel) {
-               s->type = COMEDI_SUBD_AO;
-               s->subdev_flags = SDF_WRITEABLE | SDF_GROUND | SDF_COMMON;
-               s->n_chan = devpriv->s_EeParameters.i_NbrAoChannel;
-               s->maxdata = devpriv->s_EeParameters.i_AoMaxdata;
-               s->len_chanlist =
-                       devpriv->s_EeParameters.i_NbrAoChannel;
-       } else {
-               s->type = COMEDI_SUBD_UNUSED;
-       }
+       s->type = COMEDI_SUBD_UNUSED;
+
        /*  Allocate and Initialise DI Subdevice Structures */
        s = &dev->subdevices[2];
-       if (devpriv->s_EeParameters.i_NbrDiChannel) {
-               s->type = COMEDI_SUBD_DI;
-               s->subdev_flags = SDF_READABLE | SDF_GROUND | SDF_COMMON;
-               s->n_chan = devpriv->s_EeParameters.i_NbrDiChannel;
-               s->maxdata = 1;
-               s->len_chanlist =
-                       devpriv->s_EeParameters.i_NbrDiChannel;
-               s->range_table = &range_digital;
-       } else {
-               s->type = COMEDI_SUBD_UNUSED;
-       }
+       s->type = COMEDI_SUBD_UNUSED;
+
        /*  Allocate and Initialise DO Subdevice Structures */
        s = &dev->subdevices[3];
-       if (devpriv->s_EeParameters.i_NbrDoChannel) {
-               s->type = COMEDI_SUBD_DO;
-               s->subdev_flags =
-                       SDF_READABLE | SDF_WRITEABLE | SDF_GROUND | SDF_COMMON;
-               s->n_chan = devpriv->s_EeParameters.i_NbrDoChannel;
-               s->maxdata = devpriv->s_EeParameters.i_DoMaxdata;
-               s->len_chanlist =
-                       devpriv->s_EeParameters.i_NbrDoChannel;
-               s->range_table = &range_digital;
-       } else {
-               s->type = COMEDI_SUBD_UNUSED;
-       }
+       s->type = COMEDI_SUBD_UNUSED;
 
        /*  Allocate and Initialise Timer Subdevice Structures */
        s = &dev->subdevices[4];
This page took 0.025275 seconds and 5 git commands to generate.