fbdev: newport: newport_*wait() return 0 on timeout
authorRoel Kluin <roel.kluin@gmail.com>
Tue, 31 Mar 2009 22:25:30 +0000 (15:25 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 1 Apr 2009 15:59:31 +0000 (08:59 -0700)
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>
include/video/newport.h

index 1f5ebea..001b935 100644 (file)
@@ -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;
@@ -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;