staging: comedi: me4000: remove struct me4000_dio_info
authorH Hartley Sweeten <hartleys@visionengravers.com>
Sat, 8 Sep 2012 00:39:50 +0000 (17:39 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 8 Sep 2012 04:45:27 +0000 (21:45 -0700)
The me4000_dio_info in the boardinfo struct is used to indicate
the number of 8 bit dio ports the the board has. Add a 'dio_nchan'
field to struct me4000_board and remove the struct me4000_dio_info.
The 'dio_nchan' value can then be used directly in the attach of
the board when setting the subdevice number of channels.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/comedi/drivers/me4000.c
drivers/staging/comedi/drivers/me4000.h

index 492b47e3fe7606e336ea24752a0c77191289dd75..8ca02305890e8f8f2922bfe75aecd8999cb8d56e 100644 (file)
@@ -71,9 +71,7 @@ static const struct me4000_board me4000_boards[] = {
                .ai             = {
                        .count          = 16,
                },
-               .dio            = {
-                       .count          = 4,
-               },
+               .dio_nchan      = 32,
        }, {
                .name           = "ME-4660",
                .device_id      = 0x4660,
@@ -81,9 +79,7 @@ static const struct me4000_board me4000_boards[] = {
                        .count          = 32,
                        .diff_count     = 16,
                },
-               .dio            = {
-                       .count          = 4,
-               },
+               .dio_nchan      = 32,
                .has_counter    = 1,
        }, {
                .name           = "ME-4660i",
@@ -92,9 +88,7 @@ static const struct me4000_board me4000_boards[] = {
                        .count          = 32,
                        .diff_count     = 16,
                },
-               .dio            = {
-                       .count          = 4,
-               },
+               .dio_nchan      = 32,
                .has_counter    = 1,
        }, {
                .name           = "ME-4660s",
@@ -104,9 +98,7 @@ static const struct me4000_board me4000_boards[] = {
                        .sh_count       = 8,
                        .diff_count     = 16,
                },
-               .dio            = {
-                       .count          = 4,
-               },
+               .dio_nchan      = 32,
                .has_counter    = 1,
        }, {
                .name           = "ME-4660is",
@@ -116,9 +108,7 @@ static const struct me4000_board me4000_boards[] = {
                        .sh_count       = 8,
                        .diff_count     = 16,
                },
-               .dio            = {
-                       .count          = 4,
-               },
+               .dio_nchan      = 32,
                .has_counter    = 1,
        }, {
                .name           = "ME-4670",
@@ -131,9 +121,7 @@ static const struct me4000_board me4000_boards[] = {
                        .diff_count     = 16,
                        .ex_trig_analog = 1,
                },
-               .dio            = {
-                       .count          = 4,
-               },
+               .dio_nchan      = 32,
                .has_counter    = 1,
        }, {
                .name           = "ME-4670i",
@@ -146,9 +134,7 @@ static const struct me4000_board me4000_boards[] = {
                        .diff_count     = 16,
                        .ex_trig_analog = 1,
                },
-               .dio            = {
-                       .count          = 4,
-               },
+               .dio_nchan      = 32,
                .has_counter    = 1,
        }, {
                .name           = "ME-4670s",
@@ -162,9 +148,7 @@ static const struct me4000_board me4000_boards[] = {
                        .diff_count     = 16,
                        .ex_trig_analog = 1,
                },
-               .dio            = {
-                       .count          = 4,
-               },
+               .dio_nchan      = 32,
                .has_counter    = 1,
        }, {
                .name           = "ME-4670is",
@@ -178,9 +162,7 @@ static const struct me4000_board me4000_boards[] = {
                        .diff_count     = 16,
                        .ex_trig_analog = 1,
                },
-               .dio            = {
-                       .count          = 4,
-               },
+               .dio_nchan      = 32,
                .has_counter    = 1,
        }, {
                .name           = "ME-4680",
@@ -194,9 +176,7 @@ static const struct me4000_board me4000_boards[] = {
                        .diff_count     = 16,
                        .ex_trig_analog = 1,
                },
-               .dio            = {
-                       .count          = 4,
-               },
+               .dio_nchan      = 32,
                .has_counter    = 1,
        }, {
                .name           = "ME-4680i",
@@ -210,9 +190,7 @@ static const struct me4000_board me4000_boards[] = {
                        .diff_count     = 16,
                        .ex_trig_analog = 1,
                },
-               .dio            = {
-                       .count          = 4,
-               },
+               .dio_nchan      = 32,
                .has_counter    = 1,
        }, {
                .name           = "ME-4680s",
@@ -227,9 +205,7 @@ static const struct me4000_board me4000_boards[] = {
                        .diff_count     = 16,
                        .ex_trig_analog = 1,
                },
-               .dio            = {
-                       .count          = 4,
-               },
+               .dio_nchan      = 32,
                .has_counter    = 1,
        }, {
                .name           = "ME-4680is",
@@ -244,9 +220,7 @@ static const struct me4000_board me4000_boards[] = {
                        .diff_count     = 16,
                        .ex_trig_analog = 1,
                },
-               .dio            = {
-                       .count          = 4,
-               },
+               .dio_nchan      = 32,
                .has_counter    = 1,
        },
 };
@@ -2239,10 +2213,10 @@ static int me4000_attach(struct comedi_device *dev, struct comedi_devconfig *it)
 
        s = &dev->subdevices[2];
 
-       if (thisboard->dio.count) {
+       if (thisboard->dio_nchan) {
                s->type = COMEDI_SUBD_DIO;
                s->subdev_flags = SDF_READABLE | SDF_WRITABLE;
-               s->n_chan = thisboard->dio.count * 8;
+               s->n_chan = thisboard->dio_nchan;
                s->maxdata = 1;
                s->range_table = &range_digital;
                s->insn_bits = me4000_dio_insn_bits;
index 2b609d721d85d1d78729314b6124cd7a9bcf5add..12b5c1f1d9b4963d3e45bf983c371d2f61b66944 100644 (file)
@@ -268,16 +268,12 @@ struct me4000_ai_info {
        int ex_trig_analog;
 };
 
-struct me4000_dio_info {
-       int count;
-};
-
 struct me4000_board {
        const char *name;
        unsigned short device_id;
        struct me4000_ao_info ao;
        struct me4000_ai_info ai;
-       struct me4000_dio_info dio;
+       int dio_nchan;
        int has_counter;
 };