]> git.sur5r.net Git - u-boot/blobdiff - drivers/spi/bfin_spi.c
Merge branch 'next' of git://git.denx.de/u-boot-mpc83xx
[u-boot] / drivers / spi / bfin_spi.c
index a9a4d92c3e719b0a1f215393ac7fc22de6cae8cf..f7192c23401a11b0ffa9605300cda5ed6e508914 100644 (file)
@@ -144,10 +144,8 @@ void spi_set_speed(struct spi_slave *slave, uint hz)
        u32 baud;
 
        sclk = get_sclk();
-       baud = sclk / (2 * hz);
        /* baud should be rounded up */
-       if (sclk % (2 * hz))
-               baud += 1;
+       baud = DIV_ROUND_UP(sclk, 2 * hz);
        if (baud < 2)
                baud = 2;
        else if (baud > (u16)-1)