[PATCH 7/7] staging: vt6655: Convert macro PCAvDelayByIO to function

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

 



Convert do-while(0) macro PCAvDelayByIO to function and relocate.

Signed-off-by: Philipp Hortmann <philipp.g.hortmann@xxxxxxxxx>
---
 drivers/staging/vt6655/srom.c | 13 +++++++++++++
 drivers/staging/vt6655/srom.h |  2 ++
 drivers/staging/vt6655/upc.h  | 13 -------------
 3 files changed, 15 insertions(+), 13 deletions(-)

diff --git a/drivers/staging/vt6655/srom.c b/drivers/staging/vt6655/srom.c
index 1612c9702e31..8373aa783d76 100644
--- a/drivers/staging/vt6655/srom.c
+++ b/drivers/staging/vt6655/srom.c
@@ -139,3 +139,16 @@ void SROMvReadEtherAddress(void __iomem *iobase,
 		pbyEtherAddress++;
 	}
 }
+
+void PCAvDelayByIO(unsigned char u_delay_unit)
+{
+	unsigned char data;
+	unsigned long ii;
+
+	if (u_delay_unit <= 50) {
+		udelay(u_delay_unit);
+	} else {
+		for (ii = 0; ii < (u_delay_unit); ii++)
+			data = inb(0x61);
+	}
+}
diff --git a/drivers/staging/vt6655/srom.h b/drivers/staging/vt6655/srom.h
index b03073ffa18a..c34523c77d02 100644
--- a/drivers/staging/vt6655/srom.h
+++ b/drivers/staging/vt6655/srom.h
@@ -82,4 +82,6 @@ void SROMvReadAllContents(void __iomem *iobase, unsigned char *pbyEepromRegs);
 void SROMvReadEtherAddress(void __iomem *iobase,
 			   unsigned char *pbyEtherAddress);
 
+void PCAvDelayByIO(unsigned char u_delay_unit);
+
 #endif /* __EEPROM_H__*/
diff --git a/drivers/staging/vt6655/upc.h b/drivers/staging/vt6655/upc.h
index 7d5075ec3162..05e0cf2e7d97 100644
--- a/drivers/staging/vt6655/upc.h
+++ b/drivers/staging/vt6655/upc.h
@@ -38,19 +38,6 @@
 #define VNS_OUT_PORTD(io_address, data) \
 	iowrite32((u32)(data), io_address)
 
-#define PCAvDelayByIO(u_delay_unit)				\
-do {								\
-	unsigned char __maybe_unused data;			\
-	unsigned long ii;					\
-								\
-	if (u_delay_unit <= 50) {					\
-		udelay(u_delay_unit);				\
-	} else {						\
-		for (ii = 0; ii < (u_delay_unit); ii++)		\
-			data = inb(0x61);			\
-	}							\
-} while (0)
-
 /*---------------------  Export Classes  ----------------------------*/
 
 /*---------------------  Export Variables  --------------------------*/
-- 
2.25.1





[Index of Archives]     [Linux Driver Development]     [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