forked from Minki/linux
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
@ -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 New Issue
Block a user