i2c: Limit locking scope in i2c_detach_client

We only need to hold adapter->clist_lock when we touch the client list.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
This commit is contained in:
Jean Delvare 2008-01-27 18:14:51 +01:00 committed by Jean Delvare
parent 86ec5ec872
commit 9ddced16bb

View file

@ -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: