diff options
author | Mario Six <mario.six@gdsys.cc> | 2019-04-29 01:58:43 +0530 |
---|---|---|
committer | Jagan Teki <jagan@amarulasolutions.com> | 2019-06-10 17:59:48 +0530 |
commit | 76c82afef353aa4f36a22bf2d2ed5e53bba931f0 (patch) | |
tree | 2b100456c6407810abe96f343944da6e2cdd18c7 /drivers/spi | |
parent | 1a907e41dc194f0887ff4de76c61d5d6f4465d0e (diff) | |
download | u-boot-76c82afef353aa4f36a22bf2d2ed5e53bba931f0.tar.gz u-boot-76c82afef353aa4f36a22bf2d2ed5e53bba931f0.tar.xz u-boot-76c82afef353aa4f36a22bf2d2ed5e53bba931f0.zip |
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>
Diffstat (limited to 'drivers/spi')
-rw-r--r-- | drivers/spi/mpc8xxx_spi.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/drivers/spi/mpc8xxx_spi.c b/drivers/spi/mpc8xxx_spi.c index da9e1e3f98..ca34570901 100644 --- a/drivers/spi/mpc8xxx_spi.c +++ b/drivers/spi/mpc8xxx_spi.c @@ -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); - if (bitlen <= 16) { - if (bitlen <= 4) - clrsetbits_be32(&spi->mode, 0x00f00000, - (3 << 20)); - else - clrsetbits_be32(&spi->mode, 0x00f00000, - ((bitlen - 1) << 20)); + if (bitlen <= 4) { + clrsetbits_be32(&spi->mode, 0x00f00000, (3 << 20)); + } else if (bitlen <= 16) { + clrsetbits_be32(&spi->mode, 0x00f00000, + ((bitlen - 1) << 20)); } else { clrbits_be32(&spi->mode, 0x00f00000); /* Set up the next iteration if sending > 32 bits */ |