]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
Merge remote-tracking branch 'spi/topic/tegra' into spi-next
authorMark Brown <broonie@linaro.org>
Wed, 23 Oct 2013 10:51:07 +0000 (11:51 +0100)
committerMark Brown <broonie@linaro.org>
Wed, 23 Oct 2013 10:51:07 +0000 (11:51 +0100)
drivers/spi/spi-tegra114.c
drivers/spi/spi-tegra20-sflash.c
drivers/spi/spi-tegra20-slink.c

index bb3a19f2ed390dd75de8a128ffcd4297dcd2bce5..b3821fb9da3f8212e5cd753bd9f2832bbc41d5a1 100644 (file)
@@ -267,7 +267,7 @@ static unsigned tegra_spi_calculate_curr_xfer_param(
        unsigned max_len;
        unsigned total_fifo_words;
 
-       tspi->bytes_per_word = (bits_per_word - 1) / 8 + 1;
+       tspi->bytes_per_word = DIV_ROUND_UP(bits_per_word, 8);
 
        if (bits_per_word == 8 || bits_per_word == 16) {
                tspi->is_packed = 1;
index a68d7797a8ec595a7d96747d546b9ce121f347f1..79be8ce6a9d11368389c97faa0047c8ab5b5d8e1 100644 (file)
@@ -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;
index 829283e785d9e51dd1cfb038e59fac7c04edf2a8..c74ee87b243b5a8c3bb1792dd8c3001b3fccca6c 100644 (file)
@@ -283,7 +283,7 @@ static unsigned tegra_slink_calculate_curr_xfer_param(
        unsigned total_fifo_words;
 
        bits_per_word = t->bits_per_word;
-       tspi->bytes_per_word = (bits_per_word - 1) / 8 + 1;
+       tspi->bytes_per_word = DIV_ROUND_UP(bits_per_word, 8);
 
        if (bits_per_word == 8 || bits_per_word == 16) {
                tspi->is_packed = 1;