spi_bfin5xx: limit reaches -1
authorRoel Kluin <roel.kluin@gmail.com>
Wed, 17 Jun 2009 23:26:02 +0000 (16:26 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 18 Jun 2009 20:03:41 +0000 (13:03 -0700)
bfin_spi_flush() returns limit, which reaches -1 upon timeout.  but in
function bfin_spi_pump_transfers() it is compared with 0.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Acked-by: David Brownell <dbrownell@users.sourceforge.net>
Cc: Bryan Wu <cooloney@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/spi/spi_bfin5xx.c

index 011c5bddba6a52b9741ee39c9a573efcb9f972df..2e5fd097733404edcf75652a06bc34d2bd909ca8 100644 (file)
@@ -169,7 +169,7 @@ static int bfin_spi_flush(struct driver_data *drv_data)
        unsigned long limit = loops_per_jiffy << 1;
 
        /* wait for stop and clear stat */
-       while (!(read_STAT(drv_data) & BIT_STAT_SPIF) && limit--)
+       while (!(read_STAT(drv_data) & BIT_STAT_SPIF) && --limit)
                cpu_relax();
 
        write_STAT(drv_data, BIT_STAT_CLR);