[PATCH 37/67 v2] staging: comedi: pcl816: move pcl816_reset()

H Hartley Sweeten hsweeten at visionengravers.com
Tue Mar 4 18:29:57 UTC 2014


For aesthetics, move this function to follow the pcl812 and pcl818 drivers
better.

Remove the commented out cut-and-paste code from the pcl818 driver.

Signed-off-by: H Hartley Sweeten <hsweeten at visionengravers.com>
Cc: Ian Abbott <abbotti at mev.co.uk>
Cc: Greg Kroah-Hartman <gregkh at linuxfoundation.org>
---
 drivers/staging/comedi/drivers/pcl816.c | 43 +++++++++++++++------------------
 1 file changed, 20 insertions(+), 23 deletions(-)

diff --git a/drivers/staging/comedi/drivers/pcl816.c b/drivers/staging/comedi/drivers/pcl816.c
index 2283010..2487e44 100644
--- a/drivers/staging/comedi/drivers/pcl816.c
+++ b/drivers/staging/comedi/drivers/pcl816.c
@@ -552,29 +552,6 @@ static int pcl816_ai_cancel(struct comedi_device *dev,
 	return 0;
 }
 
-static void pcl816_reset(struct comedi_device *dev)
-{
-	unsigned long timer_base = dev->iobase + PCL816_TIMER_BASE;
-
-/* outb (0, dev->iobase + PCL818_DA_LO);         DAC=0V */
-/* outb (0, dev->iobase + PCL818_DA_HI); */
-/* udelay (1); */
-	outb(0, dev->iobase + PCL816_CONTROL);
-	outb(0, dev->iobase + PCL816_MUX);
-	outb(0, dev->iobase + PCL816_CLRINT);
-
-	/* Stop pacer */
-	i8254_set_mode(timer_base, 0, 2, I8254_MODE0 | I8254_BINARY);
-	i8254_set_mode(timer_base, 0, 1, I8254_MODE0 | I8254_BINARY);
-	i8254_set_mode(timer_base, 0, 0, I8254_MODE0 | I8254_BINARY);
-
-	outb(0, dev->iobase + PCL816_RANGE);
-
-	/* set all digital outputs low */
-	outb(0, dev->iobase + PCL816_DO_DI_LSB_REG);
-	outb(0, dev->iobase + PCL816_DO_DI_MSB_REG);
-}
-
 static int
 check_channel_list(struct comedi_device *dev,
 		   struct comedi_subdevice *s, unsigned int *chanlist,
@@ -679,6 +656,26 @@ static int pcl816_do_insn_bits(struct comedi_device *dev,
 	return insn->n;
 }
 
+static void pcl816_reset(struct comedi_device *dev)
+{
+	unsigned long timer_base = dev->iobase + PCL816_TIMER_BASE;
+
+	outb(0, dev->iobase + PCL816_CONTROL);
+	outb(0, dev->iobase + PCL816_MUX);
+	outb(0, dev->iobase + PCL816_CLRINT);
+
+	/* Stop pacer */
+	i8254_set_mode(timer_base, 0, 2, I8254_MODE0 | I8254_BINARY);
+	i8254_set_mode(timer_base, 0, 1, I8254_MODE0 | I8254_BINARY);
+	i8254_set_mode(timer_base, 0, 0, I8254_MODE0 | I8254_BINARY);
+
+	outb(0, dev->iobase + PCL816_RANGE);
+
+	/* set all digital outputs low */
+	outb(0, dev->iobase + PCL816_DO_DI_LSB_REG);
+	outb(0, dev->iobase + PCL816_DO_DI_MSB_REG);
+}
+
 static int pcl816_attach(struct comedi_device *dev, struct comedi_devconfig *it)
 {
 	const struct pcl816_board *board = comedi_board(dev);
-- 
1.8.5.2



More information about the devel mailing list