aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/i2c/i2c-core.c
diff options
context:
space:
mode:
authorJean Delvare <khali@linux-fr.org>2008-01-27 12:14:51 -0500
committerJean Delvare <khali@hyperion.delvare>2008-01-27 12:14:51 -0500
commit9ddced16bb901415ac46058a55bb842a7df8cc68 (patch)
treea92bb85b14c9ae02d2d7b0714a1bb89ec4292922 /drivers/i2c/i2c-core.c
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>
Diffstat (limited to 'drivers/i2c/i2c-core.c')
-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 824f12c798d6..4765a50d7537 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)
768 768
769 mutex_lock(&adapter->clist_lock); 769 mutex_lock(&adapter->clist_lock);
770 list_del(&client->list); 770 list_del(&client->list);
771 mutex_unlock(&adapter->clist_lock);
772
771 init_completion(&client->released); 773 init_completion(&client->released);
772 device_unregister(&client->dev); 774 device_unregister(&client->dev);
773 mutex_unlock(&adapter->clist_lock);
774 wait_for_completion(&client->released); 775 wait_for_completion(&client->released);
775 776
776 out: 777 out: