This member of the boardinfo isn't really necessary. All the boards
except the pci1713 have 16 digital inputs and 16 digital outputs.

There is already a 'is_pci1713' member in the boardinfo so that can
be used to determine the subdevices for the digital inputs and outputs
need to be allocated and initialized.

Signed-off-by: H Hartley Sweeten <hswee...@visionengravers.com>
Cc: Ian Abbott <abbo...@mev.co.uk>
Cc: Greg Kroah-Hartman <gre...@linuxfoundation.org>
---
 drivers/staging/comedi/drivers/adv_pci1710.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/comedi/drivers/adv_pci1710.c 
b/drivers/staging/comedi/drivers/adv_pci1710.c
index ab136dd..4d0de74 100644
--- a/drivers/staging/comedi/drivers/adv_pci1710.c
+++ b/drivers/staging/comedi/drivers/adv_pci1710.c
@@ -132,7 +132,6 @@ struct boardtype {
        unsigned int has_large_fifo:1;  /* 4K or 1K FIFO */
        unsigned int has_diff_ai:1;
        unsigned int has_ao:1;
-       unsigned int has_di_do:1;
 };
 
 static const struct boardtype boardtypes[] = {
@@ -142,7 +141,6 @@ static const struct boardtype boardtypes[] = {
                .has_large_fifo = 1,
                .has_diff_ai    = 1,
                .has_ao         = 1,
-               .has_di_do      = 1,
        },
        [BOARD_PCI1710HG] = {
                .name           = "pci1710hg",
@@ -150,13 +148,11 @@ static const struct boardtype boardtypes[] = {
                .has_large_fifo = 1,
                .has_diff_ai    = 1,
                .has_ao         = 1,
-               .has_di_do      = 1,
        },
        [BOARD_PCI1711] = {
                .name           = "pci1711",
                .rangelist_ai   = &pci1711_ai_range,
                .has_ao         = 1,
-               .has_di_do      = 1,
        },
        [BOARD_PCI1713] = {
                .name           = "pci1713",
@@ -168,7 +164,6 @@ static const struct boardtype boardtypes[] = {
        [BOARD_PCI1731] = {
                .name           = "pci1731",
                .rangelist_ai   = &pci1711_ai_range,
-               .has_di_do      = 1,
        },
 };
 
@@ -775,7 +770,7 @@ static int pci1710_auto_attach(struct comedi_device *dev,
        n_subdevices = 2;
        if (board->has_ao)
                n_subdevices++;
-       if (board->has_di_do)
+       if (!board->is_pci1713) /* all others have digital input and output */
                n_subdevices += 2;
 
        ret = comedi_alloc_subdevices(dev, n_subdevices);
@@ -837,7 +832,7 @@ static int pci1710_auto_attach(struct comedi_device *dev,
                subdev++;
        }
 
-       if (board->has_di_do) {
+       if (!board->is_pci1713) {
                s = &dev->subdevices[subdev];
                s->type         = COMEDI_SUBD_DI;
                s->subdev_flags = SDF_READABLE;
-- 
2.5.1

_______________________________________________
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

Reply via email to