summaryrefslogtreecommitdiffstats
path: root/drivers/spi/spi_imx.c
diff options
context:
space:
mode:
authorRoel Kluin <roel.kluin@gmail.com>2009-04-06 19:00:54 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2009-04-07 08:31:07 -0700
commitc8fc657e6a114fadf78fdf8103e289a169c91c5d (patch)
tree1520389a952ea5f9d624f06d054b7d68f5802b2f /drivers/spi/spi_imx.c
parent93b61bddc13d9acf1fe341b39d826e80f3182d1e (diff)
downloadop-kernel-dev-c8fc657e6a114fadf78fdf8103e289a169c91c5d.zip
op-kernel-dev-c8fc657e6a114fadf78fdf8103e289a169c91c5d.tar.gz
spi: limit reaches -1, tested 0
With a postfix decrement limit will reach -1 rather than 0, so the warning will not be issued. Also, add a cpu_relax() into the busy-wait loop. Signed-off-by: Roel Kluin <roel.kluin@gmail.com> Cc: Mariusz Ceier <mceier@gmail.com> Acked-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/spi/spi_imx.c')
-rw-r--r--drivers/spi/spi_imx.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/spi/spi_imx.c b/drivers/spi/spi_imx.c
index 0480d8bb..014af69 100644
--- a/drivers/spi/spi_imx.c
+++ b/drivers/spi/spi_imx.c
@@ -779,7 +779,8 @@ static irqreturn_t interrupt_transfer(struct driver_data *drv_data)
/* Read trailing bytes */
limit = loops_per_jiffy << 1;
- while ((read(drv_data) == 0) && limit--);
+ while ((read(drv_data) == 0) && --limit)
+ cpu_relax();
if (limit == 0)
dev_err(&drv_data->pdev->dev,
OpenPOWER on IntegriCloud