summaryrefslogtreecommitdiffstats
path: root/drivers/spi/spi-fsl-lpspi.c
diff options
context:
space:
mode:
authorGao Pan <pandy.gao@nxp.com>2016-11-24 12:04:42 +0100
committerMark Brown <broonie@kernel.org>2016-11-25 14:04:47 +0100
commit14de3918eacfc624023775c319e85e6597514195 (patch)
tree625f20f1d1031d5ddb1ce6f7a5c4be3ba5c0ecf4 /drivers/spi/spi-fsl-lpspi.c
parentspi: imx: fix potential shift truncation (diff)
downloadlinux-14de3918eacfc624023775c319e85e6597514195.tar.xz
linux-14de3918eacfc624023775c319e85e6597514195.zip
spi: imx: replace schedule() with cond_resched()
It's more rational that just do the schedule when necessary other than do it every time. Thus, it's better to replace schedule() with cond_resched() in fsl_lpspi_txfifo_empty(), which contributes to saving cpu time. Signed-off-by: Gao Pan <pandy.gao@nxp.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/spi/spi-fsl-lpspi.c')
-rw-r--r--drivers/spi/spi-fsl-lpspi.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/spi/spi-fsl-lpspi.c b/drivers/spi/spi-fsl-lpspi.c
index 18a269d2e2f8..539c971b9f05 100644
--- a/drivers/spi/spi-fsl-lpspi.c
+++ b/drivers/spi/spi-fsl-lpspi.c
@@ -176,7 +176,7 @@ static int fsl_lpspi_txfifo_empty(struct fsl_lpspi_data *fsl_lpspi)
dev_dbg(fsl_lpspi->dev, "txfifo empty timeout\n");
return -ETIMEDOUT;
}
- schedule();
+ cond_resched();
} while (txcnt);