OSDN Git Service

staging: comedi: adl_pci9118: move digitial output (*insn_bits) function
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Fri, 5 Sep 2014 16:25:35 +0000 (09:25 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 8 Sep 2014 20:56:07 +0000 (13:56 -0700)
For aesthetics, move the digital outputs (*insn_bits) function so it
is not located in the middle of the analog input functions. Also,
rename it for consistency.

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 03ca818..a9fd343 100644 (file)
@@ -566,25 +566,6 @@ static int pci9118_insn_bits_di(struct comedi_device *dev,
        return insn->n;
 }
 
-static int pci9118_insn_bits_do(struct comedi_device *dev,
-                               struct comedi_subdevice *s,
-                               struct comedi_insn *insn,
-                               unsigned int *data)
-{
-       /*
-        * The digital outputs are set with the same register that
-        * the digital inputs and outputs are read from. But the
-        * outputs are set with bits [3:0] so we can simply write
-        * the s->state to set them.
-        */
-       if (comedi_dio_update_state(s, data))
-               outl(s->state, dev->iobase + PCI9118_DIO_REG);
-
-       data[1] = s->state;
-
-       return insn->n;
-}
-
 static void interrupt_pci9118_ai_mode4_switch(struct comedi_device *dev)
 {
        struct pci9118_private *devpriv = dev->private;
@@ -1667,6 +1648,25 @@ static int pci9118_ai_cmd(struct comedi_device *dev, struct comedi_subdevice *s)
        return ret;
 }
 
+static int pci9118_do_insn_bits(struct comedi_device *dev,
+                               struct comedi_subdevice *s,
+                               struct comedi_insn *insn,
+                               unsigned int *data)
+{
+       /*
+        * The digital outputs are set with the same register that
+        * the digital inputs and outputs are read from. But the
+        * outputs are set with bits [3:0] so we can simply write
+        * the s->state to set them.
+        */
+       if (comedi_dio_update_state(s, data))
+               outl(s->state, dev->iobase + PCI9118_DIO_REG);
+
+       data[1] = s->state;
+
+       return insn->n;
+}
+
 static int pci9118_reset(struct comedi_device *dev)
 {
        struct pci9118_private *devpriv = dev->private;
@@ -1905,7 +1905,7 @@ static int pci9118_common_attach(struct comedi_device *dev, int disable_irq,
        s->n_chan       = 4;
        s->maxdata      = 1;
        s->range_table  = &range_digital;
-       s->insn_bits    = pci9118_insn_bits_do;
+       s->insn_bits    = pci9118_do_insn_bits;
 
        devpriv->ai_maskharderr = 0x10a;
                                        /* default measure crash condition */