aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAxel Lin <axel.lin@ingics.com>2014-03-26 21:26:38 -0400
committerMark Brown <broonie@linaro.org>2014-04-14 12:06:17 -0400
commit0c3b97487d15a452f1fa7bfd9b6f1bd1a31d538d (patch)
tree4c5f3bfc546c5ddbf29073b3b5ad525a2f6a9d39
parentc9eaa447e77efe77b7fa4c953bd62de8297fd6c5 (diff)
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>
-rw-r--r--drivers/spi/spi-atmel.c4
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 {
224 struct platform_device *pdev; 224 struct platform_device *pdev;
225 225
226 struct spi_transfer *current_transfer; 226 struct spi_transfer *current_transfer;
227 unsigned long current_remaining_bytes; 227 int current_remaining_bytes;
228 int done_status; 228 int done_status;
229 229
230 struct completion xfer_completion; 230 struct completion xfer_completion;
@@ -1110,6 +1110,8 @@ static int atmel_spi_one_transfer(struct spi_master *master,
1110 atmel_spi_next_xfer_pio(master, xfer); 1110 atmel_spi_next_xfer_pio(master, xfer);
1111 } else { 1111 } else {
1112 as->current_remaining_bytes -= len; 1112 as->current_remaining_bytes -= len;
1113 if (as->current_remaining_bytes < 0)
1114 as->current_remaining_bytes = 0;
1113 } 1115 }
1114 } else { 1116 } else {
1115 atmel_spi_next_xfer_pio(master, xfer); 1117 atmel_spi_next_xfer_pio(master, xfer);