Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 123051
b: refs/heads/master
c: e6a437e
h: refs/heads/master
i:
  123049: 69f83bf
  123047: 01e4215
v: v3
  • Loading branch information
Anton Vorontsov authored and Paul Mackerras committed Dec 3, 2008
1 parent 679e507 commit 3df0621
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: 3f3b1632022fcc8317fa3b3c1236471415b3a6b8
refs/heads/master: e6a437eba09f1c3505bedf7a9a9766a878ca09fa
11 changes: 11 additions & 0 deletions trunk/drivers/of/of_i2c.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ void of_register_i2c_devices(struct i2c_adapter *adap,

for_each_child_of_node(adap_node, node) {
struct i2c_board_info info = {};
struct dev_archdata dev_ad = {};
const u32 *addr;
int len;

Expand All @@ -41,6 +42,9 @@ void of_register_i2c_devices(struct i2c_adapter *adap,

info.addr = *addr;

dev_archdata_set_node(&dev_ad, node);
info.archdata = &dev_ad;

request_module("%s", info.type);

result = i2c_new_device(adap, &info);
Expand All @@ -51,6 +55,13 @@ void of_register_i2c_devices(struct i2c_adapter *adap,
irq_dispose_mapping(info.irq);
continue;
}

/*
* Get the node to not lose the dev_archdata->of_node.
* Currently there is no way to put it back, as well as no
* of_unregister_i2c_devices() call.
*/
of_node_get(node);
}
}
EXPORT_SYMBOL(of_register_i2c_devices);
Expand Down

0 comments on commit 3df0621

Please sign in to comment.