Skip to content

Commit

Permalink
spi: imx: replace schedule() with cond_resched()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Gao Pan authored and Mark Brown committed Nov 25, 2016
1 parent e3a4939 commit 14de391
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/spi/spi-fsl-lpspi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 14de391

Please sign in to comment.