summaryrefslogtreecommitdiffstats
path: root/drivers/spi/spi-mxs.c
diff options
context:
space:
mode:
authorMarek Vasut <marex@denx.de>2012-09-04 04:40:16 +0200
committerMark Brown <broonie@opensource.wolfsonmicro.com>2012-09-06 01:42:11 +0200
commit204e706fa2ac1a62ff6423039945eb567c6c7efc (patch)
treee314ad7d3ae45cd1302e4fb57c34944f3367d270 /drivers/spi/spi-mxs.c
parentmxs/spi: Fix issues when doing long continuous transfer (diff)
downloadlinux-204e706fa2ac1a62ff6423039945eb567c6c7efc.tar.xz
linux-204e706fa2ac1a62ff6423039945eb567c6c7efc.zip
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>
Diffstat (limited to 'drivers/spi/spi-mxs.c')
-rw-r--r--drivers/spi/spi-mxs.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/spi/spi-mxs.c b/drivers/spi/spi-mxs.c
index bcba098e97c5..138c8523dbba 100644
--- a/drivers/spi/spi-mxs.c
+++ b/drivers/spi/spi-mxs.c
@@ -473,12 +473,12 @@ static int mxs_spi_transfer_one(struct spi_master *master,
&first, &last, 0);
}
- m->actual_length += t->len;
if (status) {
stmp_reset_block(ssp->base);
break;
}
+ m->actual_length += t->len;
first = last = 0;
}