diff options
author | Troy Kisky <troy.kisky@boundarydevices.com> | 2008-07-14 22:38:21 +0200 |
---|---|---|
committer | Jean Delvare <khali@mahadeva.delvare> | 2008-07-14 22:38:21 +0200 |
commit | 2e7437879897a4185bd84478a0451e5367dee7ed (patch) | |
tree | 345d40055737b3067e598fe483a17c65ca8bb831 /drivers/i2c/busses/i2c-davinci.c | |
parent | i2c-davinci: Fix signal handling bug (diff) | |
download | linux-2e7437879897a4185bd84478a0451e5367dee7ed.tar.xz linux-2e7437879897a4185bd84478a0451e5367dee7ed.zip |
i2c-davinci: Initialize cmd_complete sooner
If an interrupt happens before an I2c master read/write,
complete is called on uninitialized structure.
Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>
Signed-off-by: Kevin Hilman <khilman@mvista.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Diffstat (limited to 'drivers/i2c/busses/i2c-davinci.c')
-rw-r--r-- | drivers/i2c/busses/i2c-davinci.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/i2c/busses/i2c-davinci.c b/drivers/i2c/busses/i2c-davinci.c index 160857296952..af3846eda985 100644 --- a/drivers/i2c/busses/i2c-davinci.c +++ b/drivers/i2c/busses/i2c-davinci.c @@ -262,7 +262,7 @@ i2c_davinci_xfer_msg(struct i2c_adapter *adap, struct i2c_msg *msg, int stop) davinci_i2c_write_reg(dev, DAVINCI_I2C_CNT_REG, dev->buf_len); - init_completion(&dev->cmd_complete); + INIT_COMPLETION(dev->cmd_complete); dev->cmd_err = 0; /* Take I2C out of reset, configure it as master and set the @@ -519,6 +519,7 @@ static int davinci_i2c_probe(struct platform_device *pdev) goto err_release_region; } + init_completion(&dev->cmd_complete); dev->dev = get_device(&pdev->dev); dev->irq = irq->start; platform_set_drvdata(pdev, dev); |