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:
@@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user