summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorAxel Lin <axel.lin@ingics.com>2013-07-12 17:42:15 +0800
committerJagannadha Sutradharudu Teki <jaganna@xilinx.com>2013-08-06 23:58:24 +0530
commit583fe6c3d82b502acad5f7698a62253ba9d9304b (patch)
treec3df623b90873e9680057d07b6147c3bc5ae227a /drivers
parenta444aa7a1cd9c209e6621fe0531f61f2f7c1a7e9 (diff)
downloadu-boot-imx-583fe6c3d82b502acad5f7698a62253ba9d9304b.zip
u-boot-imx-583fe6c3d82b502acad5f7698a62253ba9d9304b.tar.gz
u-boot-imx-583fe6c3d82b502acad5f7698a62253ba9d9304b.tar.bz2
spi: mpc8xxx_spi: Use DIV_ROUND_UP instead of open-coded
Use DIV_ROUND_UP to simplify the code. Signed-off-by: Axel Lin <axel.lin@ingics.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/spi/mpc8xxx_spi.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/spi/mpc8xxx_spi.c b/drivers/spi/mpc8xxx_spi.c
index bbfc259..348361a 100644
--- a/drivers/spi/mpc8xxx_spi.c
+++ b/drivers/spi/mpc8xxx_spi.c
@@ -77,7 +77,7 @@ int spi_xfer(struct spi_slave *slave, unsigned int bitlen, const void *dout,
{
volatile spi8xxx_t *spi = &((immap_t *) (CONFIG_SYS_IMMR))->spi;
unsigned int tmpdout, tmpdin, event;
- int numBlks = bitlen / 32 + (bitlen % 32 ? 1 : 0);
+ int numBlks = DIV_ROUND_UP(bitlen, 32);
int tm, isRead = 0;
unsigned char charSize = 32;