Commit 9ddced16 authored by Jean Delvare's avatar Jean Delvare Committed by Jean Delvare

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: default avatarJean Delvare <khali@linux-fr.org>
parent 86ec5ec8
...@@ -768,9 +768,10 @@ int i2c_detach_client(struct i2c_client *client) ...@@ -768,9 +768,10 @@ int i2c_detach_client(struct i2c_client *client)
mutex_lock(&adapter->clist_lock); mutex_lock(&adapter->clist_lock);
list_del(&client->list); list_del(&client->list);
mutex_unlock(&adapter->clist_lock);
init_completion(&client->released); init_completion(&client->released);
device_unregister(&client->dev); device_unregister(&client->dev);
mutex_unlock(&adapter->clist_lock);
wait_for_completion(&client->released); wait_for_completion(&client->released);
out: out:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment