summaryrefslogtreecommitdiff
path: root/drivers/spi
diff options
context:
space:
mode:
authorMario Six <mario.six@gdsys.cc>2019-04-28 23:28:51 +0300
committerJagan Teki <jagan@amarulasolutions.com>2019-06-10 15:29:49 +0300
commitf6fcad5f2a889db6fb26afd71ed92dde00cb85e1 (patch)
tree88ebbf7419a03eb949d1aca57194a06443c398c6 /drivers/spi
parenta1c178e4c7eede986a31c18d413b33095136dbae (diff)
downloadu-boot-f6fcad5f2a889db6fb26afd71ed92dde00cb85e1.tar.xz
spi: mpc8xxx: Fix if check
Decreasing the bit length and increasing the write data pointer should be done when there are more than 32 bit of data, not 16 bit. This did not produce incorrect behavior, because the only time where the two checks produce different outcomes is the case of 16 < bitlen < 32, and in this case the subsequent transmission is the last one regardless, hence the additional bit length decrease and write data pointer increase has no effect anyway. Still, the correct check is the check for "bitlen > 32", so correct this behavior. Signed-off-by: Mario Six <mario.six@gdsys.cc> Acked-by: Jagan Teki <jagan@amarulasolutions.com>
Diffstat (limited to 'drivers/spi')
-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 1e7c0144c2..e09e91c8e9 100644
--- a/drivers/spi/mpc8xxx_spi.c
+++ b/drivers/spi/mpc8xxx_spi.c
@@ -132,7 +132,7 @@ int spi_xfer(struct spi_slave *slave, uint bitlen, const void *dout, void *din,
/* Shift data so it's msb-justified */
tmpdout = *(u32 *)dout >> (32 - xfer_bitlen);
- if (bitlen > 16) {
+ if (bitlen > 32) {
/* Set up the next iteration if sending > 32 bits */
bitlen -= 32;
dout += 4;