[PATCH 08/21] staging: comedi: c6xdigio: tidy up C6X_encInput()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxxxxxxx>
Cc: Ian Abbott <abbotti@xxxxxxxxx>
Cc: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
---
 drivers/staging/comedi/drivers/c6xdigio.c | 65 ++++++++++++++++---------------
 1 file changed, 33 insertions(+), 32 deletions(-)

diff --git a/drivers/staging/comedi/drivers/c6xdigio.c b/drivers/staging/comedi/drivers/c6xdigio.c
index c72e3a4..114ca43 100644
--- a/drivers/staging/comedi/drivers/c6xdigio.c
+++ b/drivers/staging/comedi/drivers/c6xdigio.c
@@ -143,54 +143,55 @@ static void c6xdigio_pwm_write(struct comedi_device *dev,
 	c6xdigio_chk_status(dev->iobase, 0x80);
 }
 
-static int C6X_encInput(unsigned long baseAddr, unsigned channel)
+static int c6xdigio_encoder_read(struct comedi_device *dev,
+				 unsigned int chan)
 {
 	unsigned ppcmd;
 	union encvaluetype enc;
 
 	enc.value = 0;
-	if (channel == 0)
+	if (chan == 0)
 		ppcmd = 0x48;
 	else
 		ppcmd = 0x50;
 
-	outb_p(ppcmd, baseAddr);
-	c6xdigio_chk_status(baseAddr, 0x00);
+	outb_p(ppcmd, dev->iobase);
+	c6xdigio_chk_status(dev->iobase, 0x00);
 
-	enc.bits.sb0 = ((inb(baseAddr + 1) >> 3) & 0x7);
-	outb_p(ppcmd + 0x4, baseAddr);
-	c6xdigio_chk_status(baseAddr, 0x80);
+	enc.bits.sb0 = ((inb(dev->iobase + 1) >> 3) & 0x7);
+	outb_p(ppcmd + 0x4, dev->iobase);
+	c6xdigio_chk_status(dev->iobase, 0x80);
 
-	enc.bits.sb1 = ((inb(baseAddr + 1) >> 3) & 0x7);
-	outb_p(ppcmd, baseAddr);
-	c6xdigio_chk_status(baseAddr, 0x00);
+	enc.bits.sb1 = ((inb(dev->iobase + 1) >> 3) & 0x7);
+	outb_p(ppcmd, dev->iobase);
+	c6xdigio_chk_status(dev->iobase, 0x00);
 
-	enc.bits.sb2 = ((inb(baseAddr + 1) >> 3) & 0x7);
-	outb_p(ppcmd + 0x4, baseAddr);
-	c6xdigio_chk_status(baseAddr, 0x80);
+	enc.bits.sb2 = ((inb(dev->iobase + 1) >> 3) & 0x7);
+	outb_p(ppcmd + 0x4, dev->iobase);
+	c6xdigio_chk_status(dev->iobase, 0x80);
 
-	enc.bits.sb3 = ((inb(baseAddr + 1) >> 3) & 0x7);
-	outb_p(ppcmd, baseAddr);
-	c6xdigio_chk_status(baseAddr, 0x00);
+	enc.bits.sb3 = ((inb(dev->iobase + 1) >> 3) & 0x7);
+	outb_p(ppcmd, dev->iobase);
+	c6xdigio_chk_status(dev->iobase, 0x00);
 
-	enc.bits.sb4 = ((inb(baseAddr + 1) >> 3) & 0x7);
-	outb_p(ppcmd + 0x4, baseAddr);
-	c6xdigio_chk_status(baseAddr, 0x80);
+	enc.bits.sb4 = ((inb(dev->iobase + 1) >> 3) & 0x7);
+	outb_p(ppcmd + 0x4, dev->iobase);
+	c6xdigio_chk_status(dev->iobase, 0x80);
 
-	enc.bits.sb5 = ((inb(baseAddr + 1) >> 3) & 0x7);
-	outb_p(ppcmd, baseAddr);
-	c6xdigio_chk_status(baseAddr, 0x00);
+	enc.bits.sb5 = ((inb(dev->iobase + 1) >> 3) & 0x7);
+	outb_p(ppcmd, dev->iobase);
+	c6xdigio_chk_status(dev->iobase, 0x00);
 
-	enc.bits.sb6 = ((inb(baseAddr + 1) >> 3) & 0x7);
-	outb_p(ppcmd + 0x4, baseAddr);
-	c6xdigio_chk_status(baseAddr, 0x80);
+	enc.bits.sb6 = ((inb(dev->iobase + 1) >> 3) & 0x7);
+	outb_p(ppcmd + 0x4, dev->iobase);
+	c6xdigio_chk_status(dev->iobase, 0x80);
 
-	enc.bits.sb7 = ((inb(baseAddr + 1) >> 3) & 0x7);
-	outb_p(ppcmd, baseAddr);
-	c6xdigio_chk_status(baseAddr, 0x00);
+	enc.bits.sb7 = ((inb(dev->iobase + 1) >> 3) & 0x7);
+	outb_p(ppcmd, 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);
 
 	return enc.value ^ 0x800000;
 }
@@ -229,11 +230,11 @@ static int c6xdigio_ei_insn_read(struct comedi_device *dev,
 				 struct comedi_subdevice *s,
 				 struct comedi_insn *insn, unsigned int *data)
 {
+	unsigned int chan = CR_CHAN(insn->chanspec);
 	int n;
-	int chan = CR_CHAN(insn->chanspec);
 
 	for (n = 0; n < insn->n; n++)
-		data[n] = (C6X_encInput(dev->iobase, chan) & 0xffffff);
+		data[n] = (c6xdigio_encoder_read(dev, chan) & 0xffffff);
 
 	return n;
 }
-- 
1.8.5.2

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel




[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux