aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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: