From: H Hartley Sweeten Date: Mon, 10 Mar 2014 21:07:22 +0000 (-0700) Subject: staging: comedi: c6xdigio: remove ReadByteFromHwPort() X-Git-Tag: v4.14-rc1~7811^2~270 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f2aee30e831476dc7a3b270559bf81f6a906a479;p=platform%2Fkernel%2Flinux-rpi.git staging: comedi: c6xdigio: remove ReadByteFromHwPort() This CamelCase function is just a wrapper around inb(). Remove it. Signed-off-by: H Hartley Sweeten Reviewed-by: Ian Abbott Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/comedi/drivers/c6xdigio.c b/drivers/staging/comedi/drivers/c6xdigio.c index 5034f66..26659cc 100644 --- a/drivers/staging/comedi/drivers/c6xdigio.c +++ b/drivers/staging/comedi/drivers/c6xdigio.c @@ -43,12 +43,6 @@ http://robot0.ge.uiuc.edu/~spong/mecha/ #include "../comedidev.h" -static u8 ReadByteFromHwPort(unsigned long addr) -{ - u8 result = inb(addr); - return result; -} - static void WriteByteToHwPort(unsigned long addr, u8 val) { outb_p(val, addr); @@ -95,28 +89,28 @@ static void C6X_pwmInit(unsigned long baseAddr) int timeout = 0; WriteByteToHwPort(baseAddr, 0x70); - while (((ReadByteFromHwPort(baseAddr + 1) & 0x80) == 0) + while (((inb(baseAddr + 1) & 0x80) == 0) && (timeout < C6XDIGIO_TIME_OUT)) { timeout++; } WriteByteToHwPort(baseAddr, 0x74); timeout = 0; - while (((ReadByteFromHwPort(baseAddr + 1) & 0x80) == 0x80) + while (((inb(baseAddr + 1) & 0x80) == 0x80) && (timeout < C6XDIGIO_TIME_OUT)) { timeout++; } WriteByteToHwPort(baseAddr, 0x70); timeout = 0; - while (((ReadByteFromHwPort(baseAddr + 1) & 0x80) == 0x0) + while (((inb(baseAddr + 1) & 0x80) == 0x0) && (timeout < C6XDIGIO_TIME_OUT)) { timeout++; } WriteByteToHwPort(baseAddr, 0x0); timeout = 0; - while (((ReadByteFromHwPort(baseAddr + 1) & 0x80) == 0x80) + while (((inb(baseAddr + 1) & 0x80) == 0x80) && (timeout < C6XDIGIO_TIME_OUT)) { timeout++; } @@ -143,47 +137,47 @@ static void C6X_pwmOutput(unsigned long baseAddr, unsigned channel, int value) } /* endif */ WriteByteToHwPort(baseAddr, ppcmd + pwm.bits.sb0); - tmp = ReadByteFromHwPort(baseAddr + 1); + tmp = inb(baseAddr + 1); while (((tmp & 0x80) == 0) && (timeout < C6XDIGIO_TIME_OUT)) { - tmp = ReadByteFromHwPort(baseAddr + 1); + tmp = inb(baseAddr + 1); timeout++; } WriteByteToHwPort(baseAddr, ppcmd + pwm.bits.sb1 + 0x4); timeout = 0; - tmp = ReadByteFromHwPort(baseAddr + 1); + tmp = inb(baseAddr + 1); while (((tmp & 0x80) == 0x80) && (timeout < C6XDIGIO_TIME_OUT)) { - tmp = ReadByteFromHwPort(baseAddr + 1); + tmp = inb(baseAddr + 1); timeout++; } WriteByteToHwPort(baseAddr, ppcmd + pwm.bits.sb2); - tmp = ReadByteFromHwPort(baseAddr + 1); + tmp = inb(baseAddr + 1); while (((tmp & 0x80) == 0) && (timeout < C6XDIGIO_TIME_OUT)) { - tmp = ReadByteFromHwPort(baseAddr + 1); + tmp = inb(baseAddr + 1); timeout++; } WriteByteToHwPort(baseAddr, ppcmd + pwm.bits.sb3 + 0x4); timeout = 0; - tmp = ReadByteFromHwPort(baseAddr + 1); + tmp = inb(baseAddr + 1); while (((tmp & 0x80) == 0x80) && (timeout < C6XDIGIO_TIME_OUT)) { - tmp = ReadByteFromHwPort(baseAddr + 1); + tmp = inb(baseAddr + 1); timeout++; } WriteByteToHwPort(baseAddr, ppcmd + pwm.bits.sb4); - tmp = ReadByteFromHwPort(baseAddr + 1); + tmp = inb(baseAddr + 1); while (((tmp & 0x80) == 0) && (timeout < C6XDIGIO_TIME_OUT)) { - tmp = ReadByteFromHwPort(baseAddr + 1); + tmp = inb(baseAddr + 1); timeout++; } WriteByteToHwPort(baseAddr, 0x0); timeout = 0; - tmp = ReadByteFromHwPort(baseAddr + 1); + tmp = inb(baseAddr + 1); while (((tmp & 0x80) == 0x80) && (timeout < C6XDIGIO_TIME_OUT)) { - tmp = ReadByteFromHwPort(baseAddr + 1); + tmp = inb(baseAddr + 1); timeout++; } @@ -203,82 +197,82 @@ static int C6X_encInput(unsigned long baseAddr, unsigned channel) ppcmd = 0x50; WriteByteToHwPort(baseAddr, ppcmd); - tmp = ReadByteFromHwPort(baseAddr + 1); + tmp = inb(baseAddr + 1); while (((tmp & 0x80) == 0) && (timeout < C6XDIGIO_TIME_OUT)) { - tmp = ReadByteFromHwPort(baseAddr + 1); + tmp = inb(baseAddr + 1); timeout++; } - enc.bits.sb0 = ((ReadByteFromHwPort(baseAddr + 1) >> 3) & 0x7); + enc.bits.sb0 = ((inb(baseAddr + 1) >> 3) & 0x7); WriteByteToHwPort(baseAddr, ppcmd + 0x4); timeout = 0; - tmp = ReadByteFromHwPort(baseAddr + 1); + tmp = inb(baseAddr + 1); while (((tmp & 0x80) == 0x80) && (timeout < C6XDIGIO_TIME_OUT)) { - tmp = ReadByteFromHwPort(baseAddr + 1); + tmp = inb(baseAddr + 1); timeout++; } - enc.bits.sb1 = ((ReadByteFromHwPort(baseAddr + 1) >> 3) & 0x7); + enc.bits.sb1 = ((inb(baseAddr + 1) >> 3) & 0x7); WriteByteToHwPort(baseAddr, ppcmd); timeout = 0; - tmp = ReadByteFromHwPort(baseAddr + 1); + tmp = inb(baseAddr + 1); while (((tmp & 0x80) == 0) && (timeout < C6XDIGIO_TIME_OUT)) { - tmp = ReadByteFromHwPort(baseAddr + 1); + tmp = inb(baseAddr + 1); timeout++; } - enc.bits.sb2 = ((ReadByteFromHwPort(baseAddr + 1) >> 3) & 0x7); + enc.bits.sb2 = ((inb(baseAddr + 1) >> 3) & 0x7); WriteByteToHwPort(baseAddr, ppcmd + 0x4); timeout = 0; - tmp = ReadByteFromHwPort(baseAddr + 1); + tmp = inb(baseAddr + 1); while (((tmp & 0x80) == 0x80) && (timeout < C6XDIGIO_TIME_OUT)) { - tmp = ReadByteFromHwPort(baseAddr + 1); + tmp = inb(baseAddr + 1); timeout++; } - enc.bits.sb3 = ((ReadByteFromHwPort(baseAddr + 1) >> 3) & 0x7); + enc.bits.sb3 = ((inb(baseAddr + 1) >> 3) & 0x7); WriteByteToHwPort(baseAddr, ppcmd); timeout = 0; - tmp = ReadByteFromHwPort(baseAddr + 1); + tmp = inb(baseAddr + 1); while (((tmp & 0x80) == 0) && (timeout < C6XDIGIO_TIME_OUT)) { - tmp = ReadByteFromHwPort(baseAddr + 1); + tmp = inb(baseAddr + 1); timeout++; } - enc.bits.sb4 = ((ReadByteFromHwPort(baseAddr + 1) >> 3) & 0x7); + enc.bits.sb4 = ((inb(baseAddr + 1) >> 3) & 0x7); WriteByteToHwPort(baseAddr, ppcmd + 0x4); timeout = 0; - tmp = ReadByteFromHwPort(baseAddr + 1); + tmp = inb(baseAddr + 1); while (((tmp & 0x80) == 0x80) && (timeout < C6XDIGIO_TIME_OUT)) { - tmp = ReadByteFromHwPort(baseAddr + 1); + tmp = inb(baseAddr + 1); timeout++; } - enc.bits.sb5 = ((ReadByteFromHwPort(baseAddr + 1) >> 3) & 0x7); + enc.bits.sb5 = ((inb(baseAddr + 1) >> 3) & 0x7); WriteByteToHwPort(baseAddr, ppcmd); timeout = 0; - tmp = ReadByteFromHwPort(baseAddr + 1); + tmp = inb(baseAddr + 1); while (((tmp & 0x80) == 0x0) && (timeout < C6XDIGIO_TIME_OUT)) { - tmp = ReadByteFromHwPort(baseAddr + 1); + tmp = inb(baseAddr + 1); timeout++; } - enc.bits.sb6 = ((ReadByteFromHwPort(baseAddr + 1) >> 3) & 0x7); + enc.bits.sb6 = ((inb(baseAddr + 1) >> 3) & 0x7); WriteByteToHwPort(baseAddr, ppcmd + 0x4); timeout = 0; - tmp = ReadByteFromHwPort(baseAddr + 1); + tmp = inb(baseAddr + 1); while (((tmp & 0x80) == 0x80) && (timeout < C6XDIGIO_TIME_OUT)) { - tmp = ReadByteFromHwPort(baseAddr + 1); + tmp = inb(baseAddr + 1); timeout++; } - enc.bits.sb7 = ((ReadByteFromHwPort(baseAddr + 1) >> 3) & 0x7); + enc.bits.sb7 = ((inb(baseAddr + 1) >> 3) & 0x7); WriteByteToHwPort(baseAddr, ppcmd); timeout = 0; - tmp = ReadByteFromHwPort(baseAddr + 1); + tmp = inb(baseAddr + 1); while (((tmp & 0x80) == 0x0) && (timeout < C6XDIGIO_TIME_OUT)) { - tmp = ReadByteFromHwPort(baseAddr + 1); + tmp = inb(baseAddr + 1); timeout++; } WriteByteToHwPort(baseAddr, 0x0); timeout = 0; - tmp = ReadByteFromHwPort(baseAddr + 1); + tmp = inb(baseAddr + 1); while (((tmp & 0x80) == 0x80) && (timeout < C6XDIGIO_TIME_OUT)) { - tmp = ReadByteFromHwPort(baseAddr + 1); + tmp = inb(baseAddr + 1); timeout++; } @@ -290,25 +284,25 @@ static void C6X_encResetAll(unsigned long baseAddr) unsigned timeout = 0; WriteByteToHwPort(baseAddr, 0x68); - while (((ReadByteFromHwPort(baseAddr + 1) & 0x80) == 0) + while (((inb(baseAddr + 1) & 0x80) == 0) && (timeout < C6XDIGIO_TIME_OUT)) { timeout++; } WriteByteToHwPort(baseAddr, 0x6C); timeout = 0; - while (((ReadByteFromHwPort(baseAddr + 1) & 0x80) == 0x80) + while (((inb(baseAddr + 1) & 0x80) == 0x80) && (timeout < C6XDIGIO_TIME_OUT)) { timeout++; } WriteByteToHwPort(baseAddr, 0x68); timeout = 0; - while (((ReadByteFromHwPort(baseAddr + 1) & 0x80) == 0x0) + while (((inb(baseAddr + 1) & 0x80) == 0x0) && (timeout < C6XDIGIO_TIME_OUT)) { timeout++; } WriteByteToHwPort(baseAddr, 0x0); timeout = 0; - while (((ReadByteFromHwPort(baseAddr + 1) & 0x80) == 0x80) + while (((inb(baseAddr + 1) & 0x80) == 0x80) && (timeout < C6XDIGIO_TIME_OUT)) { timeout++; }