mirror of
https://source.denx.de/u-boot/u-boot.git
synced 2025-11-28 14:11:29 +01:00
spi: mpc8xxx: Simplify if
Instead of having a nested if block, just have two branches within the overarching if block to eliminate one nesting level. Signed-off-by: Mario Six <mario.six@gdsys.cc> Acked-by: Jagan Teki <jagan@amarulasolutions.com>
This commit is contained in:
parent
1a907e41dc
commit
76c82afef3
@ -120,13 +120,11 @@ int spi_xfer(struct spi_slave *slave, uint bitlen, const void *dout, void *din,
|
|||||||
|
|
||||||
clrbits_be32(&spi->mode, SPI_MODE_EN);
|
clrbits_be32(&spi->mode, SPI_MODE_EN);
|
||||||
|
|
||||||
if (bitlen <= 16) {
|
if (bitlen <= 4) {
|
||||||
if (bitlen <= 4)
|
clrsetbits_be32(&spi->mode, 0x00f00000, (3 << 20));
|
||||||
clrsetbits_be32(&spi->mode, 0x00f00000,
|
} else if (bitlen <= 16) {
|
||||||
(3 << 20));
|
clrsetbits_be32(&spi->mode, 0x00f00000,
|
||||||
else
|
((bitlen - 1) << 20));
|
||||||
clrsetbits_be32(&spi->mode, 0x00f00000,
|
|
||||||
((bitlen - 1) << 20));
|
|
||||||
} else {
|
} else {
|
||||||
clrbits_be32(&spi->mode, 0x00f00000);
|
clrbits_be32(&spi->mode, 0x00f00000);
|
||||||
/* Set up the next iteration if sending > 32 bits */
|
/* Set up the next iteration if sending > 32 bits */
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user