Skip to content

Commit

Permalink
fbdev: newport: newport_*wait() return 0 on timeout
Browse files Browse the repository at this point in the history
With a postfix decrement t reaches -1 on timeout which results in a
return of 0.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Cc: Krzysztof Helt <krzysztof.h1@poczta.fm>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Roel Kluin authored and Linus Torvalds committed Apr 1, 2009
1 parent eb8972b commit 91ad120
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions include/video/newport.h
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,7 @@ static __inline__ int newport_wait(struct newport_regs *regs)
{
int t = BUSY_TIMEOUT;

while (t--)
while (--t)
if (!(regs->cset.status & NPORT_STAT_GBUSY))
break;
return !t;
Expand All @@ -463,7 +463,7 @@ static __inline__ int newport_bfwait(struct newport_regs *regs)
{
int t = BUSY_TIMEOUT;

while (t--)
while (--t)
if(!(regs->cset.status & NPORT_STAT_BBUSY))
break;
return !t;
Expand Down

0 comments on commit 91ad120

Please sign in to comment.