Commit 204e706f authored by Marek Vasut's avatar Marek Vasut Committed by Mark Brown

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: default avatarMarek Vasut <marex@denx.de>
Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
parent 010b4818
......@@ -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;
}
......
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