staging: comedi: adl_pci9118: tidy up analog input subdevice init
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Thu, 4 Sep 2014 17:39:42 +0000 (10:39 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 8 Sep 2014 20:54:07 +0000 (13:54 -0700)
For aesthetics, add some whitespace to the analog input subdevice init.
Tidy up the subdevice n_chan initialization.

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 2ff9bc79bb18a5a1cb1a54f5225f242fe58f5b2d..225c0469cda928bd4173d4dd6cf5dcab2e27b1be 100644 (file)
@@ -1853,26 +1853,23 @@ static int pci9118_common_attach(struct comedi_device *dev, int disable_irq,
        if (ret)
                return ret;
 
+       /* Analog Input subdevice */
        s = &dev->subdevices[0];
-       s->type = COMEDI_SUBD_AI;
-       s->subdev_flags = SDF_READABLE | SDF_COMMON | SDF_GROUND | SDF_DIFF;
-       if (devpriv->usemux)
-               s->n_chan = devpriv->usemux;
-       else
-               s->n_chan = 16;
-
-       s->maxdata = board->ai_is_16bit ? 0xffff : 0x0fff;
-       s->range_table = board->is_hg ? &pci9118hg_ai_range
-                                     : &pci9118_ai_range;
-       s->insn_read = pci9118_insn_read_ai;
+       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->maxdata      = board->ai_is_16bit ? 0xffff : 0x0fff;
+       s->range_table  = board->is_hg ? &pci9118hg_ai_range
+                                      : &pci9118_ai_range;
+       s->insn_read    = pci9118_insn_read_ai;
        if (dev->irq) {
                dev->read_subdev = s;
-               s->subdev_flags |= SDF_CMD_READ;
-               s->len_chanlist = PCI9118_CHANLEN;
-               s->do_cmdtest = pci9118_ai_cmdtest;
-               s->do_cmd = pci9118_ai_cmd;
-               s->cancel = pci9118_ai_cancel;
-               s->munge = pci9118_ai_munge;
+               s->subdev_flags |= SDF_CMD_READ;
+               s->len_chanlist = PCI9118_CHANLEN;
+               s->do_cmdtest   = pci9118_ai_cmdtest;
+               s->do_cmd       = pci9118_ai_cmd;
+               s->cancel       = pci9118_ai_cancel;
+               s->munge        = pci9118_ai_munge;
        }
 
        if (s->maxdata == 0xffff) {