Skip to content

Commit

Permalink
i2c: Limit locking scope in i2c_detach_client
Browse files Browse the repository at this point in the history
We only need to hold adapter->clist_lock when we touch the client list.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
  • Loading branch information
Jean Delvare authored and Jean Delvare committed Jan 27, 2008
1 parent 86ec5ec commit 9ddced1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/i2c/i2c-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -768,9 +768,10 @@ int i2c_detach_client(struct i2c_client *client)

mutex_lock(&adapter->clist_lock);
list_del(&client->list);
mutex_unlock(&adapter->clist_lock);

init_completion(&client->released);
device_unregister(&client->dev);
mutex_unlock(&adapter->clist_lock);
wait_for_completion(&client->released);

out:
Expand Down

0 comments on commit 9ddced1

Please sign in to comment.