[U-Boot] [PATCH v2] net: gem: Enable CTRL+C in wait_for_bit
Michal Simek
michal.simek at xilinx.com
Tue Dec 1 11:37:12 CET 2015
Enable to break waiting loop at any time.
Signed-off-by: Michal Simek <michal.simek at xilinx.com>
---
Changes in v2:
- Change return value to EINTR
- Add missing header for ctrlc
drivers/net/zynq_gem.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/net/zynq_gem.c b/drivers/net/zynq_gem.c
index 858093f0d7e2..81bd8b94901b 100644
--- a/drivers/net/zynq_gem.c
+++ b/drivers/net/zynq_gem.c
@@ -13,6 +13,7 @@
#include <net.h>
#include <netdev.h>
#include <config.h>
+#include <console.h>
#include <fdtdec.h>
#include <libfdt.h>
#include <malloc.h>
@@ -447,6 +448,11 @@ static int wait_for_bit(const char *func, u32 *reg, const u32 mask,
if (get_timer(start) > timeout)
break;
+ if (ctrlc()) {
+ puts("Abort\n");
+ return -EINTR;
+ }
+
udelay(1);
}
--
1.9.1
More information about the U-Boot
mailing list