[PATCH 02/27] staging: comedi: addi_eeprom: make v_EepromWaitBusy() static

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

 



This function is only used in this file. Move it to remove the need
for the forward declaration.

Also, remove the comment about an error in the data book. It's not
really an error just someones misunderstanding about doing a byte
read of a dword register.

Signed-off-by: H Hartley Sweeten <hsweeten@xxxxxxxxxxxxxxxxxxx>
Cc: Ian Abbott <abbotti@xxxxxxxxx>
Cc: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
---
 .../staging/comedi/drivers/addi-data/addi_eeprom.c | 29 ++++++++--------------
 1 file changed, 10 insertions(+), 19 deletions(-)

diff --git a/drivers/staging/comedi/drivers/addi-data/addi_eeprom.c b/drivers/staging/comedi/drivers/addi-data/addi_eeprom.c
index 2e46a17..4e78e7d 100644
--- a/drivers/staging/comedi/drivers/addi-data/addi_eeprom.c
+++ b/drivers/staging/comedi/drivers/addi-data/addi_eeprom.c
@@ -132,13 +132,21 @@ int i_EepromReadAnlogInputHeader(unsigned short w_PCIBoardEepromAddress,
 
 unsigned short w_EepromReadWord(unsigned short w_PCIBoardEepromAddress, char *pc_PCIChipInformation,
 	unsigned short w_EepromStartAddress);
-void v_EepromWaitBusy(unsigned short w_PCIBoardEepromAddress);
 void v_EepromClock76(unsigned int dw_Address, unsigned int dw_RegisterValue);
-void v_EepromWaitBusy(unsigned short w_PCIBoardEepromAddress);
 void v_EepromSendCommand76(unsigned int dw_Address, unsigned int dw_EepromCommand,
 	unsigned char b_DataLengthInBits);
 void v_EepromCs76Read(unsigned int dw_Address, unsigned short w_offset, unsigned short *pw_Value);
 
+static void v_EepromWaitBusy(unsigned short w_PCIBoardEepromAddress)
+{
+	unsigned char b_EepromBusy = 0;
+
+	do {
+		b_EepromBusy = inb(w_PCIBoardEepromAddress + 0x3F);
+		b_EepromBusy = b_EepromBusy & 0x80;
+	} while (b_EepromBusy == 0x80);
+}
+
 unsigned short w_EepromReadWord(unsigned short w_PCIBoardEepromAddress, char *pc_PCIChipInformation,
 	unsigned short w_EepromStartAddress)
 {
@@ -221,23 +229,6 @@ unsigned short w_EepromReadWord(unsigned short w_PCIBoardEepromAddress, char *pc
 	return w_ReadWord;
 }
 
-void v_EepromWaitBusy(unsigned short w_PCIBoardEepromAddress)
-{
-	unsigned char b_EepromBusy = 0;
-
-	do
-	{
-		/* IMPORTANT */
-		/* An error has been written in the AMCC 5933 book at the page B-13 */
-		/* Ex: if you read a byte and look for the busy statusEEPROM=0x80 and   */
-		/*      the operator register is AMCC_OP_REG_MCSR+3 */
-		/*      unsigned short read  EEPROM=0x8000 andAMCC_OP_REG_MCSR+2                  */
-		/*      unsigned int read  EEPROM=0x80000000 and AMCC_OP_REG_MCSR */
-		b_EepromBusy = inb(w_PCIBoardEepromAddress + 0x3F);
-		b_EepromBusy = b_EepromBusy & 0x80;
-	} while (b_EepromBusy == 0x80);
-}
-
 void v_EepromClock76(unsigned int dw_Address, unsigned int dw_RegisterValue)
 {
 	/* Set EEPROM clock Low */
-- 
1.7.11

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/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