summaryrefslogtreecommitdiffstats
path: root/drivers/spi/spi.c
diff options
context:
space:
mode:
authorMartin Sperl <kernel@martin.sperl.org>2015-11-27 13:31:09 +0100
committerMark Brown <broonie@kernel.org>2015-11-27 13:55:22 +0100
commit77e8058810303e5c18b462adb4f761dbb4f3b657 (patch)
tree51c78e2bba952160606fb755de2b70b81aad23bf /drivers/spi/spi.c
parentLinux 4.4-rc1 (diff)
downloadlinux-77e8058810303e5c18b462adb4f761dbb4f3b657.tar.xz
linux-77e8058810303e5c18b462adb4f761dbb4f3b657.zip
spi: bugfix: spi_message.transfer_length does not get reset
When submitting an identical spi_message multiple times via spi_sync the spi_message.frame_length does not get reset to 0 in __spi_validate before adding up all spi_transfer.len resulting in frame_length > actual_length on all but the first spi_sync call. Signed-off-by: Martin Sperl <kernel@martin.sperl.org> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/spi/spi.c')
-rw-r--r--drivers/spi/spi.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c
index e2415be209d5..a0e346f3b71e 100644
--- a/drivers/spi/spi.c
+++ b/drivers/spi/spi.c
@@ -2130,6 +2130,7 @@ static int __spi_validate(struct spi_device *spi, struct spi_message *message)
* Set transfer tx_nbits and rx_nbits as single transfer default
* (SPI_NBITS_SINGLE) if it is not set for this transfer.
*/
+ message->frame_length = 0;
list_for_each_entry(xfer, &message->transfers, transfer_list) {
message->frame_length += xfer->len;
if (!xfer->bits_per_word)