Skip to content
Snippets Groups Projects
Commit 583fe6c3 authored by Axel Lin's avatar Axel Lin Committed by Jagannadha Sutradharudu Teki
Browse files

spi: mpc8xxx_spi: Use DIV_ROUND_UP instead of open-coded


Use DIV_ROUND_UP to simplify the code.

Signed-off-by: default avatarAxel Lin <axel.lin@ingics.com>
parent a444aa7a
No related branches found
No related tags found
No related merge requests found
......@@ -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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment