aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/of/device.c
diff options
context:
space:
mode:
authorJeremy Kerr <jk@ozlabs.org>2008-10-26 17:51:25 -0400
committerPaul Mackerras <paulus@samba.org>2008-10-31 01:12:01 -0400
commit6098e2ee14849e0819ffa887ebf470dcfad4a2be (patch)
treea5e6873028e49867cfd66a519a7ed8f997e36691 /drivers/of/device.c
parent16c29d180becc5bdf92fd0fc7314a44a671b5f4e (diff)
OF-device: Don't overwrite numa_node in device registration
Currently, the numa_node of OF-devices will be overwritten during device_register, which simply sets the node to -1. On cell machines, this means that devices can't find their IOMMU, which is referenced through the device's numa node. Set the numa node for OF devices with no parent, and use the lower-level device_initialize and device_add functions, so that the node is preserved. We can remove the call to set_dev_node in of_device_alloc, as it will be overwritten during register. Signed-off-by: Jeremy Kerr <jk@ozlabs.org> Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'drivers/of/device.c')
-rw-r--r--drivers/of/device.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/drivers/of/device.c b/drivers/of/device.c
index 51e5214071da..224ae6bc67b6 100644
--- a/drivers/of/device.c
+++ b/drivers/of/device.c
@@ -105,7 +105,16 @@ EXPORT_SYMBOL(of_release_dev);
105int of_device_register(struct of_device *ofdev) 105int of_device_register(struct of_device *ofdev)
106{ 106{
107 BUG_ON(ofdev->node == NULL); 107 BUG_ON(ofdev->node == NULL);
108 return device_register(&ofdev->dev); 108
109 device_initialize(&ofdev->dev);
110
111 /* device_add will assume that this device is on the same node as
112 * the parent. If there is no parent defined, set the node
113 * explicitly */
114 if (!ofdev->dev.parent)
115 set_dev_node(&ofdev->dev, of_node_to_nid(ofdev->node));
116
117 return device_add(&ofdev->dev);
109} 118}
110EXPORT_SYMBOL(of_device_register); 119EXPORT_SYMBOL(of_device_register);
111 120