From: Jean Delvare Date: Sun, 27 Jan 2008 17:14:51 +0000 (+0100) Subject: i2c: Limit locking scope in i2c_detach_client X-Git-Tag: v2.6.25-rc1~1184 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=9ddced16bb901415ac46058a55bb842a7df8cc68;p=linux-2.6-omap-h63xx.git 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 --- 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: