summaryrefslogtreecommitdiffstats
path: root/drivers/of/base.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/of/base.c')
-rw-r--r--drivers/of/base.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/drivers/of/base.c b/drivers/of/base.c
index 4c633bcd49..0a2632f963 100644
--- a/drivers/of/base.c
+++ b/drivers/of/base.c
@@ -2130,6 +2130,21 @@ static void of_probe_memory(void)
}
}
+static void of_platform_device_create_root(struct device_node *np)
+{
+ struct device_d *dev;
+ int ret;
+
+ dev = xzalloc(sizeof(*dev));
+ dev->id = DEVICE_ID_SINGLE;
+ dev->device_node = np;
+ dev_set_name(dev, "machine");
+
+ ret = platform_device_register(dev);
+ if (ret)
+ free(dev);
+}
+
int of_probe(void)
{
struct device_node *firmware;
@@ -2149,6 +2164,8 @@ int of_probe(void)
if (firmware)
of_platform_populate(firmware, NULL, NULL);
+ of_platform_device_create_root(root_node);
+
of_clk_init(root_node, NULL);
of_platform_populate(root_node, of_default_bus_match_table, NULL);