staging: comedi: addi_apci_3xxx: tidy up the digital in and out subdevice init
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Wed, 12 Jun 2013 23:13:39 +0000 (16:13 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 17 Jun 2013 21:33:41 +0000 (14:33 -0700)
For aesthetic reasons, add some whitespace to the initialization of the
digital input and output subdevices.

Fix the subdev_flags for both subdevices. The SDF_GROUND and SDF_COMMON
flags only apply to analog subdevices. Digital output subdevices do not
need the SDF_READABLE flag set.

Remove the initialization of s->io_bits. It only has meaning for
COMEDI_SUBD_DIO subdevices.

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

index 2a900702126e60abf1eab999acdc28f6a458302a..1a7b136704e02cb53275ff5f594e2641720b1932 100644 (file)
@@ -565,32 +565,31 @@ static int apci3xxx_auto_attach(struct comedi_device *dev,
        } else {
                s->type = COMEDI_SUBD_UNUSED;
        }
-       /*  Allocate and Initialise DI Subdevice Structures */
+
+       /* Digital Input subdevice */
        s = &dev->subdevices[2];
        if (board->has_dig_in) {
-               s->type = COMEDI_SUBD_DI;
-               s->subdev_flags = SDF_READABLE | SDF_GROUND | SDF_COMMON;
-               s->n_chan = 4;
-               s->maxdata = 1;
-               s->range_table = &range_digital;
-               s->io_bits = 0; /* all bits input */
-               s->insn_bits = apci3xxx_di_insn_bits;
+               s->type         = COMEDI_SUBD_DI;
+               s->subdev_flags = SDF_READABLE;
+               s->n_chan       = 4;
+               s->maxdata      = 1;
+               s->range_table  = &range_digital;
+               s->insn_bits    = apci3xxx_di_insn_bits;
        } else {
-               s->type = COMEDI_SUBD_UNUSED;
+               s->type         = COMEDI_SUBD_UNUSED;
        }
-       /*  Allocate and Initialise DO Subdevice Structures */
+
+       /* Digital Output subdevice */
        s = &dev->subdevices[3];
        if (board->has_dig_out) {
-               s->type = COMEDI_SUBD_DO;
-               s->subdev_flags =
-                       SDF_READABLE | SDF_WRITEABLE | SDF_GROUND | SDF_COMMON;
-               s->n_chan = 4;
-               s->maxdata = 1;
-               s->range_table = &range_digital;
-               s->io_bits = 0xf;       /* all bits output */
-               s->insn_bits = apci3xxx_do_insn_bits;
+               s->type         = COMEDI_SUBD_DO;
+               s->subdev_flags = SDF_WRITEABLE;
+               s->n_chan       = 4;
+               s->maxdata      = 1;
+               s->range_table  = &range_digital;
+               s->insn_bits    = apci3xxx_do_insn_bits;
        } else {
-               s->type = COMEDI_SUBD_UNUSED;
+               s->type         = COMEDI_SUBD_UNUSED;
        }
 
        /*  Allocate and Initialise Timer Subdevice Structures */