Browse Source

video, da8xx-fb: fix time out in wait_for_event()

If an event does not occur the current coding stays in an endless loop.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Heinrich Schuchardt 7 years ago
parent
commit
c16b342d90
1 changed files with 3 additions and 2 deletions
  1. 3 2
      drivers/video/da8xx-fb.c

+ 3 - 2
drivers/video/da8xx-fb.c

@@ -853,9 +853,10 @@ static u32 wait_for_event(u32 event)
 	do {
 		ret = lcdc_irq_handler();
 		udelay(1000);
-	} while (!(ret & event));
+		--timeout;
+	} while (!(ret & event) && timeout);
 
-	if (timeout <= 0) {
+	if (!(ret & event)) {
 		printf("%s: event %d not hit\n", __func__, event);
 		return -1;
 	}