Commit 6b23d46c authored by Mamta Shukla's avatar Mamta Shukla Committed by Federico Vaga

sw:spi: fix update spi_message->actual_length

The spi-ocore driver was not updating the actual_length field in the
spi_message structure. This field could be used by SPI users to see if
all bytes have been transferred.

In particular we found the problem because the m25p80 driver uses the
actual_length to determine if there are transmission errors (-EIO).
Signed-off-by: Mamta Shukla's avatarMamta Shukla <mamta.ramendra.shukla@cern.ch>
Signed-off-by: Federico Vaga's avatarFederico Vaga <federico.vaga@cern.ch>
parent 258eb8e0
......@@ -416,8 +416,9 @@ static int spi_ocores_sw_xfer_finish(struct spi_ocores *sp)
sp->cur_tx_buf = NULL;
sp->cur_rx_buf = NULL;
sp->cur_len = 0;
sp->master->cur_msg->actual_length += sp->cur_xfer->len;
return 0;
return 0;
}
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment