staging: comedi: adl_pci9118: convert private data true/false flags to bit-fields
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Tue, 9 Sep 2014 20:05:36 +0000 (13:05 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 11 Sep 2014 21:34:24 +0000 (14:34 -0700)
For aesthetics convert the private data true/false flags to bit-fields. The
'usemux' member is used in the driver as a flag. Refactor the analog input
subdevice init so this member can also be a bit-field.

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

index cc48fe57ceb5cbdb2db23da5ded6dd170b863347..98f2581a170cf7fc7ef5b2c292b75d4d88689003 100644 (file)
@@ -206,12 +206,14 @@ static const struct pci9118_boardinfo pci9118_boards[] = {
 
 struct pci9118_private {
        unsigned long iobase_a; /* base+size for AMCC chip */
-       unsigned int master;    /* master capable */
-       unsigned int usemux;    /* we want to use external multiplexor! */
+       unsigned int master:1;
+       unsigned int dma_doublebuf:1;
+       unsigned int ai_neverending:1;
+       unsigned int usedma:1;
+       unsigned int usemux:1;
        unsigned char ai_ctrl;
        unsigned char int_ctrl;
        unsigned char ai_cfg;
-       char ai_neverending;            /* we do unlimited AI */
        unsigned int ai_do;             /* what do AI? 0=nothing, 1 to 4 mode */
        unsigned int ai_act_scan;       /* how many scans we finished */
        unsigned int ai_n_realscanlen;  /*
@@ -236,7 +238,6 @@ struct pci9118_private {
                                                 * divisors for start of measure
                                                 * on external start
                                                 */
-       char dma_doublebuf;                     /* use double buffering */
        unsigned int dma_actbuf;                /* which buffer is used now */
        unsigned short *dmabuf_virt[2];         /*
                                                 * pointers to begin of
@@ -256,7 +257,6 @@ struct pci9118_private {
                                                 * bit field of external trigger
                                                 * users(0-AI, 1-AO, 2-DI, 3-DO)
                                                 */
-       unsigned char usedma;           /* =1 use DMA transfer and not INT */
        int softsshdelay;               /*
                                         * >0 use software S&H,
                                         * numer is requested delay in ns
@@ -1694,7 +1694,7 @@ static int pci9118_common_attach(struct comedi_device *dev,
                if (softsshdelay > 0)
                        if (ext_mux > 128)
                                ext_mux = 128;
-               devpriv->usemux = ext_mux;
+               devpriv->usemux = 1;
        } else {
                devpriv->usemux = 0;
        }
@@ -1722,7 +1722,7 @@ static int pci9118_common_attach(struct comedi_device *dev,
        s = &dev->subdevices[0];
        s->type         = COMEDI_SUBD_AI;
        s->subdev_flags = SDF_READABLE | SDF_COMMON | SDF_GROUND | SDF_DIFF;
-       s->n_chan       = (devpriv->usemux) ? devpriv->usemux : 16;
+       s->n_chan       = (devpriv->usemux) ? ext_mux : 16;
        s->maxdata      = board->ai_is_16bit ? 0xffff : 0x0fff;
        s->range_table  = board->is_hg ? &pci9118hg_ai_range
                                       : &pci9118_ai_range;