mxs/spi: Increment the transfer length only if transfer succeeded
The transfer function incremented (struct spi_message)->actual_length
unconditionally, even if the transfer failed. Rectify this by incrementing
this only if transfer succeeded.
Signed-off-by: Marek Vasut <marex@denx.de>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
diff --git a/drivers/spi/spi-mxs.c b/drivers/spi/spi-mxs.c
index bcba098..138c852 100644
--- a/drivers/spi/spi-mxs.c
+++ b/drivers/spi/spi-mxs.c
@@ -473,12 +473,12 @@
&first, &last, 0);
}
- m->actual_length += t->len;
if (status) {
stmp_reset_block(ssp->base);
break;
}
+ m->actual_length += t->len;
first = last = 0;
}