From: H Hartley Sweeten <hsweeten@visionengravers.com>
Date: Mon, 10 Mar 2014 21:07:28 +0000 (-0700)
Subject: staging: comedi: c6xdigio: tidy up C6X_pwmOutput()
X-Git-Tag: firefly_0821_release~176^2~4193^2~264
X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=c774049adbabffca32ca1d4d671e9623dbb4fd3d;p=firefly-linux-kernel-4.4.55.git

staging: comedi: c6xdigio: tidy up C6X_pwmOutput()

Rename the CamelCase function.

For aesthetics, pass the comedi_device pointer instead of the dev->iobase
as the first parameter.

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>
---

diff --git a/drivers/staging/comedi/drivers/c6xdigio.c b/drivers/staging/comedi/drivers/c6xdigio.c
index 9e456e5c73e4..c72e3a476128 100644
--- a/drivers/staging/comedi/drivers/c6xdigio.c
+++ b/drivers/staging/comedi/drivers/c6xdigio.c
@@ -107,40 +107,40 @@ static void c6xdigio_pwm_init(struct comedi_device *dev)
 	c6xdigio_chk_status(dev->iobase, 0x80);
 }
 
-static void C6X_pwmOutput(unsigned long baseAddr, unsigned channel, int value)
+static void c6xdigio_pwm_write(struct comedi_device *dev,
+			       unsigned int chan, unsigned int val)
 {
 	unsigned ppcmd;
 	union pwmcmdtype pwm;
 
-	pwm.cmd = value;
+	pwm.cmd = val;
 	if (pwm.cmd > 498)
 		pwm.cmd = 498;
 	if (pwm.cmd < 2)
 		pwm.cmd = 2;
 
-	if (channel == 0) {
+	if (chan == 0)
 		ppcmd = 0x28;
-	} else {		/*  if channel == 1 */
+	else
 		ppcmd = 0x30;
-	}			/* endif */
 
-	outb_p(ppcmd + pwm.bits.sb0, baseAddr);
-	c6xdigio_chk_status(baseAddr, 0x00);
+	outb_p(ppcmd + pwm.bits.sb0, dev->iobase);
+	c6xdigio_chk_status(dev->iobase, 0x00);
 
-	outb_p(ppcmd + pwm.bits.sb1 + 0x4, baseAddr);
-	c6xdigio_chk_status(baseAddr, 0x80);
+	outb_p(ppcmd + pwm.bits.sb1 + 0x4, dev->iobase);
+	c6xdigio_chk_status(dev->iobase, 0x80);
 
-	outb_p(ppcmd + pwm.bits.sb2, baseAddr);
-	c6xdigio_chk_status(baseAddr, 0x00);
+	outb_p(ppcmd + pwm.bits.sb2, dev->iobase);
+	c6xdigio_chk_status(dev->iobase, 0x00);
 
-	outb_p(ppcmd + pwm.bits.sb3 + 0x4, baseAddr);
-	c6xdigio_chk_status(baseAddr, 0x80);
+	outb_p(ppcmd + pwm.bits.sb3 + 0x4, dev->iobase);
+	c6xdigio_chk_status(dev->iobase, 0x80);
 
-	outb_p(ppcmd + pwm.bits.sb4, baseAddr);
-	c6xdigio_chk_status(baseAddr, 0x00);
+	outb_p(ppcmd + pwm.bits.sb4, dev->iobase);
+	c6xdigio_chk_status(dev->iobase, 0x00);
 
-	outb_p(0x0, baseAddr);
-	c6xdigio_chk_status(baseAddr, 0x80);
+	outb_p(0x0, dev->iobase);
+	c6xdigio_chk_status(dev->iobase, 0x80);
 }
 
 static int C6X_encInput(unsigned long baseAddr, unsigned channel)
@@ -215,11 +215,11 @@ static int c6xdigio_pwmo_insn_write(struct comedi_device *dev,
 				    struct comedi_insn *insn,
 				    unsigned int *data)
 {
+	unsigned int chan = CR_CHAN(insn->chanspec);
 	int i;
-	int chan = CR_CHAN(insn->chanspec);
 
 	for (i = 0; i < insn->n; i++) {
-		C6X_pwmOutput(dev->iobase, chan, data[i]);
+		c6xdigio_pwm_write(dev, chan, data[i]);
 		/*    devpriv->ao_readback[chan] = data[i]; */
 	}
 	return i;