Skip to content

Commit

Permalink
i2c-bfin-twi: Fix mismatch in add timer and delete timer
Browse files Browse the repository at this point in the history
Move init_completion to just before i2c transfer.
http://blackfin.uclinux.org/gf/project/uclinux-dist/tracker/?action=TrackerItemEdit&tracker_item_id=3385

Signed-off-by: Hans Schillstrom <hans.schillstrom@shlsys.com>
Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
Signed-off-by: Bryan Wu <cooloney@kernel.org>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
  • Loading branch information
Hans Schillstrom authored and Jean Delvare committed Apr 22, 2008
1 parent d4ce220 commit afc13b7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/i2c/busses/i2c-bfin-twi.c
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,7 @@ static int bfin_twi_master_xfer(struct i2c_adapter *adap,
iface->writeNum = iface->readNum = pmsg->len;
iface->result = 0;
iface->timeout_count = 10;
init_completion(&(iface->complete));
/* Set Transmit device address */
write_MASTER_ADDR(iface, pmsg->addr);

Expand Down Expand Up @@ -447,6 +448,7 @@ int bfin_twi_smbus_xfer(struct i2c_adapter *adap, u16 addr,
iface->read_write = read_write;
iface->command = command;
iface->timeout_count = 10;
init_completion(&(iface->complete));

/* FIFO Initiation. Data in FIFO should be discarded before
* start a new operation.
Expand Down Expand Up @@ -608,7 +610,6 @@ static int i2c_bfin_twi_probe(struct platform_device *pdev)
}

spin_lock_init(&(iface->lock));
init_completion(&(iface->complete));

/* Find and map our resources */
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
Expand Down

0 comments on commit afc13b7

Please sign in to comment.