Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

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
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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;
	}