[v5,11/11] of/platform: Don't create device links default busses
diff mbox series

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

Commit Message

Saravana Kannan July 12, 2019, 11:52 p.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 | 3 +++
 1 file changed, 3 insertions(+)

diff mbox series

diff --git a/drivers/of/platform.c b/drivers/of/platform.c
index 9f3b7e1801bc..b02dbaa01bfe 100644
--- a/drivers/of/platform.c
+++ b/drivers/of/platform.c
@@ -593,6 +593,9 @@  static int __of_link_to_suppliers(struct device *dev,
 	struct property *p;
 	unsigned int len, reg_len;
+	if (of_match_node(of_default_bus_match_table, con_np))
+		return 0;
 	for (i = 0; i < ARRAY_SIZE(link_bindings) / 2; i++)
 		if (of_link_binding(dev, con_np, link_bindings[i * 2],
 					link_bindings[i * 2 + 1]))