From: Ben Dooks Date: Tue, 15 Apr 2008 21:34:44 +0000 (-0700) Subject: spi: spi_s3c24xx driver must init completion X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=4bb5eba06b4bc57e30b0f6336c9907e85c395197;p=linux-beck.git spi: spi_s3c24xx driver must init completion 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 Signed-off-by: David Brownell Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/drivers/spi/spi_s3c24xx.c b/drivers/spi/spi_s3c24xx.c index e75103aac790..6f2c79da984d 100644 --- a/drivers/spi/spi_s3c24xx.c +++ b/drivers/spi/spi_s3c24xx.c @@ -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;