staging: comedi: adv_pci1710: rename pci171x_ao_insn_write()
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Fri, 13 Nov 2015 18:11:16 +0000 (11:11 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 18 Dec 2015 22:56:30 +0000 (14:56 -0800)
Rename this function so it has namespace associated with the driver.

For aesthetics, move the function so it is located in the middle of
the analog input support functions.

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

index 4566122..cc451f1 100644 (file)
@@ -362,31 +362,6 @@ static int pci171x_ai_insn_read(struct comedi_device *dev,
        return ret ? ret : insn->n;
 }
 
-static int pci171x_ao_insn_write(struct comedi_device *dev,
-                                struct comedi_subdevice *s,
-                                struct comedi_insn *insn,
-                                unsigned int *data)
-{
-       struct pci1710_private *devpriv = dev->private;
-       unsigned int chan = CR_CHAN(insn->chanspec);
-       unsigned int range = CR_RANGE(insn->chanspec);
-       unsigned int val = s->readback[chan];
-       int i;
-
-       devpriv->da_ranges &= ~(1 << (chan << 1));
-       devpriv->da_ranges |= (range << (chan << 1));
-       outw(devpriv->da_ranges, dev->iobase + PCI171X_DAREF_REG);
-
-       for (i = 0; i < insn->n; i++) {
-               val = data[i];
-               outw(val, dev->iobase + PCI171X_DA_REG(chan));
-       }
-
-       s->readback[chan] = val;
-
-       return insn->n;
-}
-
 static int pci171x_ai_cancel(struct comedi_device *dev,
                             struct comedi_subdevice *s)
 {
@@ -645,6 +620,31 @@ static int pci171x_ai_cmdtest(struct comedi_device *dev,
        return 0;
 }
 
+static int pci1710_ao_insn_write(struct comedi_device *dev,
+                                struct comedi_subdevice *s,
+                                struct comedi_insn *insn,
+                                unsigned int *data)
+{
+       struct pci1710_private *devpriv = dev->private;
+       unsigned int chan = CR_CHAN(insn->chanspec);
+       unsigned int range = CR_RANGE(insn->chanspec);
+       unsigned int val = s->readback[chan];
+       int i;
+
+       devpriv->da_ranges &= ~(1 << (chan << 1));
+       devpriv->da_ranges |= (range << (chan << 1));
+       outw(devpriv->da_ranges, dev->iobase + PCI171X_DAREF_REG);
+
+       for (i = 0; i < insn->n; i++) {
+               val = data[i];
+               outw(val, dev->iobase + PCI171X_DA_REG(chan));
+       }
+
+       s->readback[chan] = val;
+
+       return insn->n;
+}
+
 static int pci1710_di_insn_bits(struct comedi_device *dev,
                                struct comedi_subdevice *s,
                                struct comedi_insn *insn,
@@ -823,7 +823,7 @@ static int pci1710_auto_attach(struct comedi_device *dev,
                s->n_chan       = 2;
                s->maxdata      = 0x0fff;
                s->range_table  = &pci171x_ao_range;
-               s->insn_write   = pci171x_ao_insn_write;
+               s->insn_write   = pci1710_ao_insn_write;
 
                ret = comedi_alloc_subdev_readback(s);
                if (ret)