Skip to content

Commit 46b1d3b

Browse files
Avinash95francois-berder
authored andcommitted
fix saveenv command giving warning messages
Change-Id: I25bc6ab33d6975f7b931d8fe733a605d32e4978d Signed-off-by: Avinash Tahakik <[email protected]>
1 parent 1d58c47 commit 46b1d3b

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

drivers/spi/imgtec_spfi.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -762,15 +762,15 @@ int spi_xfer(struct spi_slave *slave, unsigned int bitlen, const void *dout,
762762
bytes = bitlen / 8;
763763
}
764764

765-
/* Start the transaction, if necessary. */
766-
if ((flags & SPI_XFER_BEGIN))
767-
spi_cs_activate(slave);
768-
769-
if (!dout && !din) {
765+
if (!dout && !din && (bitlen != 0)) {
770766
printf("%s: Error: both buffers are NULL.\n", __func__);
771767
return -SPIM_INVALID_TRANSFER_DESC;
772768
}
773769

770+
/* Start the transaction, if necessary. */
771+
if ((flags & SPI_XFER_BEGIN))
772+
spi_cs_activate(slave);
773+
774774
/*
775775
* Transfers with size bigger than
776776
* SPIM_MAX_TANSFER_BYTES = 64KB - 1 (0xFFFF) are divided.

0 commit comments

Comments
 (0)