Skip to content

Commit

Permalink
spi: spi_s3c24xx driver must init completion
Browse files Browse the repository at this point in the history
The s3c24xx_spi_txrx() function should initialise the completion each time
before using it, otherwise we end up with the possibility of returning success
before the interrupt handler has processed all the data.

Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Ben Dooks authored and torvalds committed Apr 16, 2008
1 parent 335e92e commit 4bb5eba
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/spi/spi_s3c24xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -192,8 +192,11 @@ static int s3c24xx_spi_txrx(struct spi_device *spi, struct spi_transfer *t)
hw->len = t->len;
hw->count = 0;

init_completion(&hw->done);

/* send the first byte */
writeb(hw_txbyte(hw, 0), hw->regs + S3C2410_SPTDAT);

wait_for_completion(&hw->done);

return hw->count;
Expand Down

0 comments on commit 4bb5eba

Please sign in to comment.