]> git.karo-electronics.de Git - linux-beck.git/commitdiff
staging: comedi: me_daq: remove {ao,ai}_resoultion_mask
authorH Hartley Sweeten <hartleys@visionengravers.com>
Thu, 25 Oct 2012 22:07:52 +0000 (15:07 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 26 Oct 2012 16:20:01 +0000 (09:20 -0700)
These values can be determined from the {ao,ai}_resolution.

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

index 7fd94000af9582a578e15fa4018661c386593304..f14907e4940d7da6ba938ff148e0472a495a65f1 100644 (file)
@@ -178,11 +178,9 @@ struct me_board {
        int device_id;
        int ao_channel_nbr;     /* DA config */
        int ao_resolution;
-       int ao_resolution_mask;
        const struct comedi_lrange *ao_range_list;
        int ai_channel_nbr;     /* AD config */
        int ai_resolution;
-       int ai_resolution_mask;
        const struct comedi_lrange *ai_range_list;
        int dio_channel_nbr;    /* DIO config */
 };
@@ -194,12 +192,10 @@ static const struct me_board me_boards[] = {
         /* Analog Output */
         .ao_channel_nbr = 4,
         .ao_resolution = 12,
-        .ao_resolution_mask = 0x0fff,
         .ao_range_list = &me2600_ao_range,
         .ai_channel_nbr = 16,
         /* Analog Input */
         .ai_resolution = 12,
-        .ai_resolution_mask = 0x0fff,
         .ai_range_list = &me2600_ai_range,
         .dio_channel_nbr = 32,
         },
@@ -209,7 +205,6 @@ static const struct me_board me_boards[] = {
         .ai_channel_nbr = 16,
         /* Analog Input */
         .ai_resolution = 12,
-        .ai_resolution_mask = 0x0fff,
         .ai_range_list = &me2000_ai_range,
         .dio_channel_nbr = 32,
         }
@@ -721,7 +716,7 @@ static int me_attach_pci(struct comedi_device *dev, struct pci_dev *pcidev)
        s->type = COMEDI_SUBD_AI;
        s->subdev_flags = SDF_READABLE | SDF_COMMON | SDF_CMD_READ;
        s->n_chan = board->ai_channel_nbr;
-       s->maxdata = board->ai_resolution_mask;
+       s->maxdata = (1 << board->ai_resolution) - 1;
        s->len_chanlist = board->ai_channel_nbr;
        s->range_table = board->ai_range_list;
        s->cancel = me_ai_cancel;
@@ -734,7 +729,7 @@ static int me_attach_pci(struct comedi_device *dev, struct pci_dev *pcidev)
                s->type = COMEDI_SUBD_AO;
                s->subdev_flags = SDF_WRITEABLE | SDF_COMMON;
                s->n_chan = board->ao_channel_nbr;
-               s->maxdata = board->ao_resolution_mask;
+               s->maxdata = (1 << board->ao_resolution) - 1;
                s->len_chanlist = board->ao_channel_nbr;
                s->range_table = board->ao_range_list;
                s->insn_read = me_ao_insn_read;