Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 37488
b: refs/heads/master
c: 77ed74d
h: refs/heads/master
v: v3
  • Loading branch information
Jean Delvare authored and Linus Torvalds committed Sep 30, 2006
1 parent 4cca5d0 commit a498aea
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 13 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 5ffd1a6aaacc25be8cd0770a51ec6d46add3a276
refs/heads/master: 77ed74da26f50fa28471571ee7a2251b77526d84
25 changes: 13 additions & 12 deletions trunk/drivers/i2c/i2c-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -420,14 +420,6 @@ int i2c_attach_client(struct i2c_client *client)
}
list_add_tail(&client->list,&adapter->clients);

if (adapter->client_register) {
if (adapter->client_register(client)) {
dev_dbg(&adapter->dev, "client_register "
"failed for client [%s] at 0x%02x\n",
client->name, client->addr);
}
}

client->usage_count = 0;

client->dev.parent = &client->adapter->dev;
Expand All @@ -445,10 +437,17 @@ int i2c_attach_client(struct i2c_client *client)
res = device_create_file(&client->dev, &dev_attr_client_name);
if (res)
goto out_unregister;

out_unlock:
mutex_unlock(&adapter->clist_lock);
return res;

if (adapter->client_register) {
if (adapter->client_register(client)) {
dev_dbg(&adapter->dev, "client_register "
"failed for client [%s] at 0x%02x\n",
client->name, client->addr);
}
}

return 0;

out_unregister:
init_completion(&client->released); /* Needed? */
Expand All @@ -458,7 +457,9 @@ int i2c_attach_client(struct i2c_client *client)
list_del(&client->list);
dev_err(&adapter->dev, "Failed to attach i2c client %s at 0x%02x "
"(%d)\n", client->name, client->addr, res);
goto out_unlock;
out_unlock:
mutex_unlock(&adapter->clist_lock);
return res;
}


Expand Down

0 comments on commit a498aea

Please sign in to comment.