]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
staging: comedi: addi_apci_1500: remove unnecessary subdevice initialization
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Tue, 14 Oct 2014 17:44:27 +0000 (10:44 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 29 Oct 2014 07:48:54 +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_1500.c

index d6d2e67c5ba70231606ae578a67f2bbe88234b3f..13b31aba2378f62bb89b0acd5263a3f064b3d511 100644 (file)
@@ -116,36 +116,12 @@ static int apci1500_auto_attach(struct comedi_device *dev,
 
        /*  Allocate and Initialise AI Subdevice Structures */
        s = &dev->subdevices[0];
-       if ((devpriv->s_EeParameters.i_NbrAiChannel)
-               || (this_board->i_NbrAiChannelDiff)) {
-               dev->read_subdev = s;
-               s->type = COMEDI_SUBD_AI;
-               s->subdev_flags =
-                       SDF_READABLE | SDF_COMMON | SDF_GROUND
-                       | SDF_DIFF;
-               if (devpriv->s_EeParameters.i_NbrAiChannel)
-                       s->n_chan = devpriv->s_EeParameters.i_NbrAiChannel;
-               else
-                       s->n_chan = this_board->i_NbrAiChannelDiff;
-               s->maxdata = devpriv->s_EeParameters.i_AiMaxdata;
-               s->len_chanlist = this_board->i_AiChannelList;
-               s->range_table = this_board->pr_AiRangelist;
-       } else {
-               s->type = COMEDI_SUBD_UNUSED;
-       }
+       s->type = COMEDI_SUBD_UNUSED;
 
        /*  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;
-       }
+
        /*  Allocate and Initialise DI Subdevice Structures */
        s = &dev->subdevices[2];
        if (devpriv->s_EeParameters.i_NbrDiChannel) {