diff options
-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 { | |||
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); |