summaryrefslogtreecommitdiff
path: root/drivers/spi/spi-rspi.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/spi/spi-rspi.c')
-rw-r--r--drivers/spi/spi-rspi.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/spi/spi-rspi.c b/drivers/spi/spi-rspi.c
index d04a4acce23..57beda20959 100644
--- a/drivers/spi/spi-rspi.c
+++ b/drivers/spi/spi-rspi.c
@@ -726,13 +726,13 @@ static int rspi_transfer_out_in(struct rspi_data *rspi,
u8 *rx_buf = xfer->rx_buf;
u8 spcr, data;
- rspi_receive_init(rspi);
-
spcr = rspi_read8(rspi, RSPI_SPCR);
- if (rx_buf)
+ if (rx_buf) {
+ rspi_receive_init(rspi);
spcr &= ~SPCR_TXMD;
- else
+ } else {
spcr |= SPCR_TXMD;
+ }
rspi_write8(rspi, spcr, RSPI_SPCR);
while (remain > 0) {