summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean Delvare <khali@linux-fr.org>2008-01-27 18:14:51 +0100
committerJean Delvare <khali@hyperion.delvare>2008-01-27 18:14:51 +0100
commit9ddced16bb901415ac46058a55bb842a7df8cc68 (patch)
treea92bb85b14c9ae02d2d7b0714a1bb89ec4292922
parent86ec5ec872566dda74848e09904bb5380cab962e (diff)
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>
-rw-r--r--drivers/i2c/i2c-core.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c
index 824f12c798d..4765a50d753 100644
--- a/drivers/i2c/i2c-core.c
+++ b/drivers/i2c/i2c-core.c
@@ -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: