diff options
author | Ingo Molnar <mingo@elte.hu> | 2008-11-03 08:57:41 +0100 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-11-03 08:57:41 +0100 |
commit | db5935001a43528e673ad26ffec9d98c60a496a9 (patch) | |
tree | 8e735327a97beccabb5d94ef93df25d2bacda705 /drivers/of/device.c | |
parent | 34f3a814eef8069a24e5b3ebcf27aba9dabac2ea (diff) | |
parent | 45beca08dd8b6d6a65c5ffd730af2eac7a2c7a03 (diff) |
Merge commit 'v2.6.28-rc3' into sched/core
Diffstat (limited to 'drivers/of/device.c')
-rw-r--r-- | drivers/of/device.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/drivers/of/device.c b/drivers/of/device.c index 51e5214071d..224ae6bc67b 100644 --- a/drivers/of/device.c +++ b/drivers/of/device.c @@ -105,7 +105,16 @@ EXPORT_SYMBOL(of_release_dev); int of_device_register(struct of_device *ofdev) { BUG_ON(ofdev->node == NULL); - return device_register(&ofdev->dev); + + device_initialize(&ofdev->dev); + + /* device_add will assume that this device is on the same node as + * the parent. If there is no parent defined, set the node + * explicitly */ + if (!ofdev->dev.parent) + set_dev_node(&ofdev->dev, of_node_to_nid(ofdev->node)); + + return device_add(&ofdev->dev); } EXPORT_SYMBOL(of_device_register); |