[v6,7/7] of/platform: Don't create device links for default busses
diff mbox series

Message ID 20190720061647.234852-8-saravanak@google.com
State Superseded
Headers show
  • Solve postboot supplier cleanup and optimize probe ordering
Related show

Commit Message

Saravana Kannan July 20, 2019, 6:16 a.m. UTC
Default busses also have devices created for them. But there's no point
in creating device links for them. It's especially wasteful as it'll
cause the traversal of the entire device tree and also spend a lot of
time checking and figuring out that creating those links isn't allowed.
So check for default busses and skip trying to create device links for

Signed-off-by: Saravana Kannan <saravanak@google.com>
 drivers/of/platform.c | 2 ++
 1 file changed, 2 insertions(+)

diff mbox series

diff --git a/drivers/of/platform.c b/drivers/of/platform.c
index c1a116f7a087..8bf975ee2ff7 100644
--- a/drivers/of/platform.c
+++ b/drivers/of/platform.c
@@ -676,6 +676,8 @@  static int of_link_to_suppliers(struct device *dev)
 		return 0;
 	if (unlikely(!dev->of_node))
 		return 0;
+	if (of_match_node(of_default_bus_match_table, dev->of_node))
+		return 0;
 	return __of_link_to_suppliers(dev, dev->of_node);