of: platform: populate /firmware/ node from of_platform_default_populate_init()
authorSudeep Holla <Sudeep.Holla@arm.com>
Thu, 28 Sep 2017 10:45:59 +0000 (11:45 +0100)
committerAndy Gross <andy.gross@linaro.org>
Thu, 4 Jan 2018 20:00:20 +0000 (14:00 -0600)
Since "/firmware" does not have its own "compatible" property as it's
just collection of nodes representing firmware interface, it's sub-nodes
are not populated during system initialization.

Currently different firmware drivers search the /firmware/ node and
populate the sub-node devices selectively. Instead we can populate
the /firmware/ node during init to avoid more drivers continuing to
populate the devices selectively.

To generalize the solution this patch populates the /firmware/ node
explicitly from of_platform_default_populate_init().

Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Rob Herring <robh@kernel.org>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
Acked-by: Rob Herring <robh@kernel.org>
Acked-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Tested-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Andy Gross <andy.gross@linaro.org>
drivers/of/platform.c

index b7cf84b297373904adddd1b08e6393eb5fef2f71..78cfb15c7890c9005d900b4050ceff66055d1e8c 100644 (file)
@@ -518,6 +518,10 @@ static int __init of_platform_default_populate_init(void)
        for_each_matching_node(node, reserved_mem_matches)
                of_platform_device_create(node, NULL, NULL);
 
+       node = of_find_node_by_path("/firmware");
+       if (node)
+               of_platform_populate(node, NULL, NULL, NULL);
+
        /* Populate everything else. */
        of_platform_default_populate(NULL, NULL, NULL);