summaryrefslogtreecommitdiff
path: root/drivers/spi
diff options
context:
space:
mode:
authorAxel Lin <axel.lin@ingics.com>2013-06-14 21:12:19 +0800
committerJagannadha Sutradharudu Teki <jaganna@xilinx.com>2013-06-22 23:08:01 +0530
commit0cb8394f8198f5b420a52b6a6f76c9bf21e68b2e (patch)
tree2d277b287eea19fb2c5a0386423ade3bc49442fd /drivers/spi
parent1e77deec6ee81e5a435057910651599a8afb9d6b (diff)
downloadu-boot-imx-0cb8394f8198f5b420a52b6a6f76c9bf21e68b2e.zip
u-boot-imx-0cb8394f8198f5b420a52b6a6f76c9bf21e68b2e.tar.gz
u-boot-imx-0cb8394f8198f5b420a52b6a6f76c9bf21e68b2e.tar.bz2
spi: cf_qspi: Use DIV_ROUND_UP at appropriate place
This change slightly improves readability. Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Richard Retanubun <richardretanubun@ruggedcom.com> Reviewed-by: Jagannadha Sutradharudu Teki <jagannadh.teki@gmail.com>
Diffstat (limited to 'drivers/spi')
-rw-r--r--drivers/spi/cf_qspi.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/spi/cf_qspi.c b/drivers/spi/cf_qspi.c
index a37ac4e..06bcf91 100644
--- a/drivers/spi/cf_qspi.c
+++ b/drivers/spi/cf_qspi.c
@@ -171,7 +171,7 @@ int spi_xfer(struct spi_slave *slave, unsigned int bitlen, const void *dout,
volatile qspi_t *qspi = dev->regs;
u8 *txbuf = (u8 *)dout;
u8 *rxbuf = (u8 *)din;
- u32 count = ((bitlen / 8) + (bitlen % 8 ? 1 : 0));
+ u32 count = DIV_ROUND_UP(bitlen, 8);
u32 n, i = 0;
/* Sanitize arguments */