From c8fc657e6a114fadf78fdf8103e289a169c91c5d Mon Sep 17 00:00:00 2001 From: Roel Kluin Date: Mon, 6 Apr 2009 19:00:54 -0700 Subject: [PATCH] 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 Cc: Mariusz Ceier Acked-by: David Brownell Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/spi/spi_imx.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/spi/spi_imx.c b/drivers/spi/spi_imx.c index 0480d8bb19d3..014af69fc1bb 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, -- 2.20.1