aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/spi/spi-tegra114.c2
-rw-r--r--drivers/spi/spi-tegra20-sflash.c2
-rw-r--r--drivers/spi/spi-tegra20-slink.c2
3 files changed, 3 insertions, 3 deletions
diff --git a/drivers/spi/spi-tegra114.c b/drivers/spi/spi-tegra114.c
index 145dd435483b..946ff7377352 100644
--- a/drivers/spi/spi-tegra114.c
+++ b/drivers/spi/spi-tegra114.c
@@ -267,7 +267,7 @@ static unsigned tegra_spi_calculate_curr_xfer_param(
267 unsigned max_len; 267 unsigned max_len;
268 unsigned total_fifo_words; 268 unsigned total_fifo_words;
269 269
270 tspi->bytes_per_word = (bits_per_word - 1) / 8 + 1; 270 tspi->bytes_per_word = DIV_ROUND_UP(bits_per_word, 8);
271 271
272 if (bits_per_word == 8 || bits_per_word == 16) { 272 if (bits_per_word == 8 || bits_per_word == 16) {
273 tspi->is_packed = 1; 273 tspi->is_packed = 1;
diff --git a/drivers/spi/spi-tegra20-sflash.c b/drivers/spi/spi-tegra20-sflash.c
index 1d814dc6e000..64c9cf511175 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(
173 unsigned remain_len = t->len - tsd->cur_pos; 173 unsigned remain_len = t->len - tsd->cur_pos;
174 unsigned max_word; 174 unsigned max_word;
175 175
176 tsd->bytes_per_word = (t->bits_per_word - 1) / 8 + 1; 176 tsd->bytes_per_word = DIV_ROUND_UP(t->bits_per_word, 8);
177 max_word = remain_len / tsd->bytes_per_word; 177 max_word = remain_len / tsd->bytes_per_word;
178 if (max_word > SPI_FIFO_DEPTH) 178 if (max_word > SPI_FIFO_DEPTH)
179 max_word = SPI_FIFO_DEPTH; 179 max_word = SPI_FIFO_DEPTH;
diff --git a/drivers/spi/spi-tegra20-slink.c b/drivers/spi/spi-tegra20-slink.c
index c70353672a23..231b84523d37 100644
--- a/drivers/spi/spi-tegra20-slink.c
+++ b/drivers/spi/spi-tegra20-slink.c
@@ -283,7 +283,7 @@ static unsigned tegra_slink_calculate_curr_xfer_param(
283 unsigned total_fifo_words; 283 unsigned total_fifo_words;
284 284
285 bits_per_word = t->bits_per_word; 285 bits_per_word = t->bits_per_word;
286 tspi->bytes_per_word = (bits_per_word - 1) / 8 + 1; 286 tspi->bytes_per_word = DIV_ROUND_UP(bits_per_word, 8);
287 287
288 if (bits_per_word == 8 || bits_per_word == 16) { 288 if (bits_per_word == 8 || bits_per_word == 16) {
289 tspi->is_packed = 1; 289 tspi->is_packed = 1;