staging: comedi: pcl726: remove the *_SIZE defines
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Wed, 25 Sep 2013 22:40:57 +0000 (15:40 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 26 Sep 2013 16:32:20 +0000 (09:32 -0700)
The *_SIZE defines are only used to initialize the 'io_range' members in
the boardinfo. Remove the defines and just open code the values.

For aesthetics, change the type of the 'io_range' and rename it to better
match the 'len' parameter to comedi_request_region().

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/pcl726.c

index 7f55c09aab9416918041668b715a084460b4d3dd..16f062a6ec1d481a4b4dd20023d5ab952241ae7e 100644 (file)
@@ -67,10 +67,6 @@ Interrupts are not supported.
 
 #include "../comedidev.h"
 
-#define PCL726_SIZE 16
-#define PCL727_SIZE 32
-#define PCL728_SIZE 8
-
 #define PCL726_AO_MSB_REG(x)   (0x00 + ((x) * 2))
 #define PCL726_AO_LSB_REG(x)   (0x01 + ((x) * 2))
 #define PCL726_DO_MSB_REG      0x0c
@@ -110,9 +106,9 @@ static const struct comedi_lrange *const rangelist_728[] = {
 
 struct pcl726_board {
        const char *name;
-       int n_aochan;
-       unsigned int io_range;
+       unsigned long io_len;
        unsigned int irq_mask;
+       int n_aochan;
        unsigned int have_dio:1;
        unsigned int is_pcl727:1;
        const struct comedi_lrange *const *ao_ranges;
@@ -122,37 +118,37 @@ struct pcl726_board {
 static const struct pcl726_board boardtypes[] = {
        {
                .name           = "pcl726",
+               .io_len         = 0x10,
                .n_aochan       = 6,
-               .io_range       = PCL726_SIZE,
                .have_dio       = 1,
                .ao_ranges      = &rangelist_726[0],
                .ao_num_ranges  = ARRAY_SIZE(rangelist_726),
        }, {
                .name           = "pcl727",
+               .io_len         = 0x20,
                .n_aochan       = 12,
-               .io_range       = PCL727_SIZE,
                .have_dio       = 1,
                .is_pcl727      = 1,
                .ao_ranges      = &rangelist_727[0],
                .ao_num_ranges  = ARRAY_SIZE(rangelist_727),
        }, {
                .name           = "pcl728",
+               .io_len         = 0x08,
                .n_aochan       = 2,
-               .io_range       = PCL728_SIZE,
                .ao_num_ranges  = ARRAY_SIZE(rangelist_728),
                .ao_ranges      = &rangelist_728[0],
        }, {
                .name           = "acl6126",
-               .n_aochan       = 6,
-               .io_range       = PCL726_SIZE,
+               .io_len         = 0x10,
                .irq_mask       = 0x96e8,
+               .n_aochan       = 6,
                .have_dio       = 1,
                .ao_num_ranges  = ARRAY_SIZE(rangelist_726),
                .ao_ranges      = &rangelist_726[0],
        }, {
                .name           = "acl6128",
+               .io_len         = 0x08,
                .n_aochan       = 2,
-               .io_range       = PCL728_SIZE,
                .ao_num_ranges  = ARRAY_SIZE(rangelist_728),
                .ao_ranges      = &rangelist_728[0],
        },
@@ -269,7 +265,7 @@ static int pcl726_attach(struct comedi_device *dev,
        int ret;
        int i;
 
-       ret = comedi_request_region(dev, it->options[0], board->io_range);
+       ret = comedi_request_region(dev, it->options[0], board->io_len);
        if (ret)
                return ret;