diff options
author | Axel Lin <axel.lin@ingics.com> | 2013-08-30 11:00:23 +0800 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2013-09-17 00:24:56 +0100 |
commit | e91d2352bb6ebd061b362b3c632ec517ac0c23b1 (patch) | |
tree | 9f7367a2ffd833b3e8f6b6e134f651af7c7e05e8 /drivers/spi/spi-tegra20-sflash.c | |
parent | 272b98c6455f00884f0350f775c5342358ebb73f (diff) | |
download | op-kernel-dev-e91d2352bb6ebd061b362b3c632ec517ac0c23b1.zip op-kernel-dev-e91d2352bb6ebd061b362b3c632ec517ac0c23b1.tar.gz |
spi: tegra: Use DIV_ROUND_UP instead of open coded
This also makes the intention more clear.
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'drivers/spi/spi-tegra20-sflash.c')
-rw-r--r-- | drivers/spi/spi-tegra20-sflash.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/spi/spi-tegra20-sflash.c b/drivers/spi/spi-tegra20-sflash.c index 1d814dc..64c9cf5 100644 --- a/drivers/spi/spi-tegra20-sflash.c +++ b/drivers/spi/spi-tegra20-sflash.c @@ -173,7 +173,7 @@ static unsigned tegra_sflash_calculate_curr_xfer_param( unsigned remain_len = t->len - tsd->cur_pos; unsigned max_word; - tsd->bytes_per_word = (t->bits_per_word - 1) / 8 + 1; + tsd->bytes_per_word = DIV_ROUND_UP(t->bits_per_word, 8); max_word = remain_len / tsd->bytes_per_word; if (max_word > SPI_FIFO_DEPTH) max_word = SPI_FIFO_DEPTH; |