From: Roel Kluin Date: Wed, 17 Jun 2009 23:26:02 +0000 (-0700) Subject: spi_bfin5xx: limit reaches -1 X-Git-Tag: MMI-PSA29.97-13-9~27851 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=b4bd2ababd20b6ecdd49cf96e39c875fbedd53af;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git spi_bfin5xx: limit reaches -1 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 Acked-by: David Brownell Cc: Bryan Wu Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/drivers/spi/spi_bfin5xx.c b/drivers/spi/spi_bfin5xx.c index 011c5bddba6a..2e5fd0977334 100644 --- a/drivers/spi/spi_bfin5xx.c +++ b/drivers/spi/spi_bfin5xx.c @@ -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);