Skip to contentSkip to conversation

spi_s3c24xx driver must init completion

PATCH In review David Brownell 1 participant 1 message Apr 15, 2008

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 3/3 spi_s3c24xx driver must init completion

From: Ben Dooks <[email protected]>

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.

---
 drivers/spi/spi_s3c24xx.c |    3 +++
 1 file changed, 3 insertions(+)
drivers/spi/spi_s3c24xx.c +3 -0
@@ -192,8 +192,11 @@ static int s3c24xx_spi_txrx(struct spi_d
 	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;

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference Don't miss this year's exciting event. There's still time to save $100. Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone