mirror of
https://source.denx.de/u-boot/u-boot.git
synced 2026-05-05 04:36:13 +02:00
spi: stm32: clean up buffer length assignment
Remove redundant divisions by using the already available xferlen variable for setting the rx/tx buffer lengths. Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com> Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
This commit is contained in:
parent
2b3a73116a
commit
17c022271d
@ -404,8 +404,8 @@ static int stm32_spi_xfer(struct udevice *slave, unsigned int bitlen,
|
||||
|
||||
priv->tx_buf = dout;
|
||||
priv->rx_buf = din;
|
||||
priv->tx_len = priv->tx_buf ? bitlen / 8 : 0;
|
||||
priv->rx_len = priv->rx_buf ? bitlen / 8 : 0;
|
||||
priv->tx_len = priv->tx_buf ? xferlen : 0;
|
||||
priv->rx_len = priv->rx_buf ? xferlen : 0;
|
||||
|
||||
mode = SPI_FULL_DUPLEX;
|
||||
if (!priv->tx_buf)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user