]> www.infradead.org Git - users/willy/xarray.git/commit
of/platform: Allow overlays to create platform devices from the root node
authorStephen Boyd <sboyd@kernel.org>
Thu, 18 Jul 2024 21:05:00 +0000 (14:05 -0700)
committerStephen Boyd <sboyd@kernel.org>
Mon, 29 Jul 2024 22:33:12 +0000 (15:33 -0700)
commit814cff595d1ff6079fb4df2fd8ceeb0b6ad2d221
treeabfa18e0fd3cb0d52e7aac60b4d6234f106451f9
parent8400291e289ee6b2bf9779ff1c83a291501f017b
of/platform: Allow overlays to create platform devices from the root node

We'd like to apply overlays to the root node in KUnit so we can test
platform devices created as children of the root node.

On some architectures (powerpc), the root node isn't marked with
OF_POPULATED_BUS. If an overlay tries to modify the root node on these
platforms it will fail, while on other platforms, such as ARM, it will
succeed. This is because the root node is marked with OF_POPULATED_BUS
by of_platform_default_populate_init() calling
of_platform_default_populate() with NULL as the first argument.

Loosen the requirement here so that platform devices can be created for
nodes created as children of the root node via DT overlays even if the
platform bus wasn't populated for the root node.

Reviewed-by: Rob Herring (Arm) <robh@kernel.org>
Cc: Saravana Kannan <saravanak@google.com>
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
[sboyd@kernel.org: Folded in condition fix]
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Link: https://lore.kernel.org/r/20240718210513.3801024-2-sboyd@kernel.org
drivers/of/platform.c