[PATCH 1/5] ARM: SoCFPGA: move wait_on_timeout to generic

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

 



To be able to use the __wait_on_timeout macro in more places, move it to
the generic socfpga header.

Signed-off-by: Steffen Trumtrar <s.trumtrar@xxxxxxxxxxxxxx>
---
 arch/arm/mach-socfpga/arria10-xload.c | 16 ----------------
 include/mach/socfpga/generic.h        | 16 ++++++++++++++++
 2 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/arch/arm/mach-socfpga/arria10-xload.c b/arch/arm/mach-socfpga/arria10-xload.c
index afec55c33a278f7aa7c13d16557881a5e13f38f9..fb87135ca94a1fd12992bc8e7fb9d1725831aad6 100644
--- a/arch/arm/mach-socfpga/arria10-xload.c
+++ b/arch/arm/mach-socfpga/arria10-xload.c
@@ -16,22 +16,6 @@
 #include <mach/socfpga/generic.h>
 #include <linux/sizes.h>
 
-#define __wait_on_timeout(timeout, condition) \
-({								\
-	int __ret = 0;						\
-	int __timeout = timeout;				\
-								\
-	while ((condition)) {					\
-		if (__timeout-- < 0) {				\
-			__ret = -ETIMEDOUT;			\
-			break;					\
-		}						\
-		arria10_kick_l4wd0();                           \
-                __udelay(1);                                    \
-	}							\
-	__ret;							\
-})
-
 int a10_update_bits(unsigned int reg, unsigned int mask,
 		    unsigned int val)
 {
diff --git a/include/mach/socfpga/generic.h b/include/mach/socfpga/generic.h
index 40224897c1d2e05b934cd49963ac4ddeaeb28a25..9891dbe4fe1016ce0732d635fdd06ae7add16ac3 100644
--- a/include/mach/socfpga/generic.h
+++ b/include/mach/socfpga/generic.h
@@ -106,6 +106,22 @@ static inline void __udelay(unsigned us)
 	for (i = 0; i < us * 3; i++);
 }
 
+#define __wait_on_timeout(timeout, condition) \
+({								\
+	int __ret = 0;						\
+	int __timeout = timeout;				\
+								\
+	while ((condition)) {					\
+		if (__timeout-- < 0) {				\
+			__ret = -ETIMEDOUT;			\
+			break;					\
+		}						\
+		arria10_kick_l4wd0();                           \
+		__udelay(1);                                    \
+	}							\
+	__ret;							\
+})
+
 struct socfpga_barebox_part {
 	unsigned int nor_offset;
 	unsigned int nor_size;

-- 
2.45.2





[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux