Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 168999
b: refs/heads/master
c: bbd2d9c
h: refs/heads/master
i:
  168997: 6dd93ac
  168995: 627975f
  168991: bef4b4b
v: v3
  • Loading branch information
Jean Delvare committed Nov 26, 2009
1 parent 2e6070f commit 566ece4
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 03b70d625c10d1605012d41489d9df18467c5f55
refs/heads/master: bbd2d9c9198c6efd449e9d395b3eaf2d03aa3bba
11 changes: 11 additions & 0 deletions trunk/drivers/i2c/i2c-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -762,6 +762,7 @@ int i2c_del_adapter(struct i2c_adapter *adap)
{
int res = 0;
struct i2c_adapter *found;
struct i2c_client *client, *next;

/* First make sure that this adapter was ever added */
mutex_lock(&core_lock);
Expand All @@ -781,6 +782,16 @@ int i2c_del_adapter(struct i2c_adapter *adap)
if (res)
return res;

/* Remove devices instantiated from sysfs */
list_for_each_entry_safe(client, next, &userspace_devices, detected) {
if (client->adapter == adap) {
dev_dbg(&adap->dev, "Removing %s at 0x%x\n",
client->name, client->addr);
list_del(&client->detected);
i2c_unregister_device(client);
}
}

/* Detach any active clients. This can't fail, thus we do not
checking the returned value. */
res = device_for_each_child(&adap->dev, NULL, __unregister_client);
Expand Down

0 comments on commit 566ece4

Please sign in to comment.