summaryrefslogtreecommitdiff
path: root/drivers/video
diff options
context:
space:
mode:
authorHeinrich Schuchardt <xypron.glpk@gmx.de>2018-03-18 16:48:06 +0300
committerAnatolij Gustschin <agust@denx.de>2018-03-19 11:49:20 +0300
commitc16b342d90a1d0b388314889560aa3bd50823df9 (patch)
treed4c7d5bad8950884b8a8b008da839dfc28d7ee2b /drivers/video
parent348f044fdabbb94c00a356553d42dfb229f6589d (diff)
downloadu-boot-c16b342d90a1d0b388314889560aa3bd50823df9.tar.xz
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>
Diffstat (limited to 'drivers/video')
-rw-r--r--drivers/video/da8xx-fb.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/video/da8xx-fb.c b/drivers/video/da8xx-fb.c
index 6ec4f89e34..26db73b138 100644
--- a/drivers/video/da8xx-fb.c
+++ b/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;
}