]> git.openfabrics.org - ~emulex/infiniband.git/commitdiff
staging: comedi: addi_apci_1564: board has 32 digital inputs
authorChase Southwood <chase.southwood@gmail.com>
Tue, 29 Apr 2014 08:34:23 +0000 (03:34 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 3 May 2014 23:56:49 +0000 (19:56 -0400)
This board always has 32 digital inputs. Remove the test when
initializing the subdevice.

Also, since this board is the only one supported by this driver,
remove the boardinfo about the digital inputs and just use the
data directly in the subdevice init.

Signed-off-by: Chase Southwood <chase.southwood@gmail.com>
Reviewed-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_1564.c

index c84e17c60cecd0b31aaa0dcb18e33cced551ab8d..fe42f9d8f1d1e153c361b53411b72bb94d154038 100644 (file)
@@ -20,8 +20,6 @@ static const struct addi_board apci1564_boardtypes[] = {
                .i_Timer                = 1,
                .interrupt              = apci1564_interrupt,
                .reset                  = apci1564_reset,
-               .di_config              = apci1564_di_config,
-               .di_bits                = apci1564_di_insn_bits,
                .do_config              = apci1564_do_config,
                .do_bits                = apci1564_do_insn_bits,
                .do_read                = apci1564_do_read,
@@ -115,21 +113,15 @@ static int apci1564_auto_attach(struct comedi_device *dev,
 
        /*  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;
-               s->insn_config = this_board->di_config;
-               s->insn_read = this_board->di_read;
-               s->insn_write = this_board->di_write;
-               s->insn_bits = this_board->di_bits;
-       } else {
-               s->type = COMEDI_SUBD_UNUSED;
-       }
+       s->type = COMEDI_SUBD_DI;
+       s->subdev_flags = SDF_READABLE;
+       s->n_chan = 32;
+       s->maxdata = 1;
+       s->len_chanlist = 32;
+       s->range_table = &range_digital;
+       s->insn_config = apci1564_di_config;
+       s->insn_bits = apci1564_di_insn_bits;
+
        /*  Allocate and Initialise DO Subdevice Structures */
        s = &dev->subdevices[3];
        if (devpriv->s_EeParameters.i_NbrDoChannel) {