Skip to content

Commit

Permalink
i2c: omap: Do not initialise the completion everytime
Browse files Browse the repository at this point in the history
Use INIT_COMPLETION instead of init_completion in transfer.

Reviewed-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Shubhrajyoti D <shubhrajyoti@ti.com>
Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
  • Loading branch information
Shubhrajyoti D authored and Wolfram Sang committed Jul 12, 2012
1 parent 5692d2a commit 0e33bbb
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/i2c/busses/i2c-omap.c
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,7 @@ static int omap_i2c_xfer_msg(struct i2c_adapter *adap,
w |= OMAP_I2C_BUF_RXFIF_CLR | OMAP_I2C_BUF_TXFIF_CLR;
omap_i2c_write_reg(dev, OMAP_I2C_BUF_REG, w);

init_completion(&dev->cmd_complete);
INIT_COMPLETION(dev->cmd_complete);
dev->cmd_err = 0;

w = OMAP_I2C_CON_EN | OMAP_I2C_CON_MST | OMAP_I2C_CON_STT;
Expand Down Expand Up @@ -999,6 +999,7 @@ omap_i2c_probe(struct platform_device *pdev)
}

platform_set_drvdata(pdev, dev);
init_completion(&dev->cmd_complete);

dev->reg_shift = (dev->flags >> OMAP_I2C_FLAG_BUS_SHIFT__SHIFT) & 3;

Expand Down

0 comments on commit 0e33bbb

Please sign in to comment.