summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--drivers/spi/bfin_spi.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/spi/bfin_spi.c b/drivers/spi/bfin_spi.c
index a9a4d92..f7192c2 100644
--- a/drivers/spi/bfin_spi.c
+++ b/drivers/spi/bfin_spi.c
@@ -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)