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

Commit 0c3b9748 authored by Axel Lin's avatar Axel Lin Committed by Mark Brown
Browse files

spi: atmel: Make current_remaining_bytes to be int



Don't use unsigned for current_remaining_bytes so we can check
current_remaining_bytes < 0 case.
Use int is enough for current_remaining_bytes.

Signed-off-by: default avatarAxel Lin <axel.lin@ingics.com>
Signed-off-by: default avatarWenyou Yang <wenyou.yang@atmel.com>
Signed-off-by: default avatarMark Brown <broonie@linaro.org>
parent c9eaa447
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -224,7 +224,7 @@ struct atmel_spi {
	struct platform_device	*pdev;

	struct spi_transfer	*current_transfer;
	unsigned long		current_remaining_bytes;
	int			current_remaining_bytes;
	int			done_status;

	struct completion	xfer_completion;
@@ -1110,6 +1110,8 @@ static int atmel_spi_one_transfer(struct spi_master *master,
				atmel_spi_next_xfer_pio(master, xfer);
			} else {
				as->current_remaining_bytes -= len;
				if (as->current_remaining_bytes < 0)
					as->current_remaining_bytes = 0;
			}
		} else {
			atmel_spi_next_xfer_pio(master, xfer);