Skip to content

Commit

Permalink
spi: atmel: Make current_remaining_bytes to be int
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Axel Lin authored and Mark Brown committed Apr 14, 2014
1 parent c9eaa44 commit 0c3b974
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/spi/spi-atmel.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 0c3b974

Please sign in to comment.