spi: altera: Use DIV_ROUND_UP to calculate hw->bytes_per_word
[platform/adaptation/renesas_rcar/renesas_kernel.git] / drivers / spi / spi-altera.c
index dce4a7e..523f2f6 100644 (file)
@@ -134,7 +134,7 @@ static int altera_spi_txrx(struct spi_device *spi, struct spi_transfer *t)
        hw->tx = t->tx_buf;
        hw->rx = t->rx_buf;
        hw->count = 0;
-       hw->bytes_per_word = t->bits_per_word / 8;
+       hw->bytes_per_word = DIV_ROUND_UP(t->bits_per_word, 8);
        hw->len = t->len / hw->bytes_per_word;
 
        if (hw->irq >= 0) {