diff options
author | Tom Rini <trini@ti.com> | 2013-06-24 16:37:01 -0400 |
---|---|---|
committer | Tom Rini <trini@ti.com> | 2013-06-24 16:37:01 -0400 |
commit | f9c1456cf632175afb7d6b27f42f1aab8432be0f (patch) | |
tree | 8bac21548110dbfdc2d0e571b8cd36be7ccda20c /drivers/spi/mxc_spi.c | |
parent | 348e47f766ac228fb02d1af562b2e9a4c69355db (diff) | |
parent | b9e31be0f8adc1a55179ae3b45c9e274f4650007 (diff) |
Merge branch 'master' of git://git.denx.de/u-boot-spi
Diffstat (limited to 'drivers/spi/mxc_spi.c')
-rw-r--r-- | drivers/spi/mxc_spi.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/spi/mxc_spi.c b/drivers/spi/mxc_spi.c index 5bed858787f..2ea322833c2 100644 --- a/drivers/spi/mxc_spi.c +++ b/drivers/spi/mxc_spi.c @@ -224,7 +224,7 @@ int spi_xchg_single(struct spi_slave *slave, unsigned int bitlen, const u8 *dout, u8 *din, unsigned long flags) { struct mxc_spi_slave *mxcs = to_mxc_spi_slave(slave); - int nbytes = (bitlen + 7) / 8; + int nbytes = DIV_ROUND_UP(bitlen, 8); u32 data, cnt, i; struct cspi_regs *regs = (struct cspi_regs *)mxcs->base; @@ -294,7 +294,7 @@ int spi_xchg_single(struct spi_slave *slave, unsigned int bitlen, /* Transfer completed, clear any pending request */ reg_write(®s->stat, MXC_CSPICTRL_TC | MXC_CSPICTRL_RXOVF); - nbytes = (bitlen + 7) / 8; + nbytes = DIV_ROUND_UP(bitlen, 8); cnt = nbytes % 32; @@ -330,7 +330,7 @@ int spi_xchg_single(struct spi_slave *slave, unsigned int bitlen, int spi_xfer(struct spi_slave *slave, unsigned int bitlen, const void *dout, void *din, unsigned long flags) { - int n_bytes = (bitlen + 7) / 8; + int n_bytes = DIV_ROUND_UP(bitlen, 8); int n_bits; int ret; u32 blk_size; |