@@ -1658,6 +1658,12 @@ static int stm32_spi_transfer_one(struct spi_master *master,
unsigned long timeout;
int ret;
+ /* Don't do anything on 0 bytes transfers */
+ if (transfer->len == 0) {
+ spi->xfer_status = 0;
+ goto finalize;
+ }
+
spi->tx_buf = transfer->tx_buf;
spi->rx_buf = transfer->rx_buf;
spi->tx_len = spi->tx_buf ? transfer->len : 0;
@@ -1702,6 +1708,7 @@ static int stm32_spi_transfer_one(struct spi_master *master,
spi->cfg->disable(spi);
+finalize:
spi_finalize_current_transfer(master);
return spi->xfer_status;
On 0 byte transfer request, return straight from the xfer function after finalizing the transfer. Signed-off-by: Alain Volmat <alain.volmat@st.com> --- drivers/spi/spi-stm32.c | 7 +++++++ 1 file changed, 7 insertions(+)