mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-11 21:38:32 +08:00
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>
This commit is contained in:
parent
010b481834
commit
204e706fa2
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user