提交 204e706f 编写于 作者: M Marek Vasut 提交者: 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: NMarek Vasut <marex@denx.de>
Signed-off-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
上级 010b4818
...@@ -473,12 +473,12 @@ static int mxs_spi_transfer_one(struct spi_master *master, ...@@ -473,12 +473,12 @@ static int mxs_spi_transfer_one(struct spi_master *master,
&first, &last, 0); &first, &last, 0);
} }
m->actual_length += t->len;
if (status) { if (status) {
stmp_reset_block(ssp->base); stmp_reset_block(ssp->base);
break; break;
} }
m->actual_length += t->len;
first = last = 0; first = last = 0;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册