[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <b7551e92f42d60ff3bb74b5e28467f09781e3d06.1648882847.git.philipp.g.hortmann@gmail.com>
Date: Sat, 2 Apr 2022 09:29:49 +0200
From: Philipp Hortmann <philipp.g.hortmann@...il.com>
To: Forest Bond <forest@...ttletooquiet.net>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
linux-staging@...ts.linux.dev, linux-kernel@...r.kernel.org
Subject: [PATCH 7/7] staging: vt6655: Convert macro PCAvDelayByIO to function
Convert do-while(0) macro PCAvDelayByIO to function and relocate.
Signed-off-by: Philipp Hortmann <philipp.g.hortmann@...il.com>
---
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
Powered by blists - more mailing lists