diff options
author | Axel Lin <axel.lin@ingics.com> | 2014-03-27 05:26:38 +0400 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2014-04-14 20:06:17 +0400 |
commit | 0c3b97487d15a452f1fa7bfd9b6f1bd1a31d538d (patch) | |
tree | 4c5f3bfc546c5ddbf29073b3b5ad525a2f6a9d39 /drivers/spi/spi-atmel.c | |
parent | c9eaa447e77efe77b7fa4c953bd62de8297fd6c5 (diff) | |
download | linux-0c3b97487d15a452f1fa7bfd9b6f1bd1a31d538d.tar.xz |
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: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'drivers/spi/spi-atmel.c')
-rw-r--r-- | drivers/spi/spi-atmel.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/spi/spi-atmel.c b/drivers/spi/spi-atmel.c index 8005f9869481..485e6cce94bf 100644 --- a/drivers/spi/spi-atmel.c +++ b/drivers/spi/spi-atmel.c @@ -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); |