Skip to content

Commit

Permalink
mxs/spi: Increment the transfer length only if transfer succeeded
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Marek Vasut authored and Mark Brown committed Sep 5, 2012
1 parent 010b481 commit 204e706
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/spi/spi-mxs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 204e706

Please sign in to comment.