mirror of
https://github.com/adulau/aha.git
synced 2024-12-28 19:56:18 +00:00
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:
parent
86ec5ec872
commit
9ddced16bb
1 changed files with 2 additions and 1 deletions
|
@ -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:
|
||||
|
|
Loading…
Reference in a new issue