]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
spi: imx: replace schedule() with cond_resched()
authorGao Pan <pandy.gao@nxp.com>
Thu, 24 Nov 2016 11:04:42 +0000 (19:04 +0800)
committerMark Brown <broonie@kernel.org>
Fri, 25 Nov 2016 13:04:47 +0000 (13:04 +0000)
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>
drivers/spi/spi-fsl-lpspi.c

index 18a269d2e2f8b4bdd307b6be49c5c6e2fb39a7c4..539c971b9f05e5702e1e39a9d02e4b3973a65bec 100644 (file)
@@ -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);