From mboxrd@z Thu Jan 1 00:00:00 1970 From: Saravana Kannan Subject: [PATCH v9 7/7] of/platform: Don't create device links for default busses Date: Wed, 31 Jul 2019 15:17:20 -0700 Message-ID: <20190731221721.187713-8-saravanak@google.com> References: <20190731221721.187713-1-saravanak@google.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Return-path: In-Reply-To: <20190731221721.187713-1-saravanak@google.com> Sender: linux-kernel-owner@vger.kernel.org To: Rob Herring , Mark Rutland , Greg Kroah-Hartman , "Rafael J. Wysocki" , Frank Rowand Cc: Saravana Kannan , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, David Collins , kernel-team@android.com List-Id: devicetree@vger.kernel.org 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 them. Signed-off-by: Saravana Kannan --- drivers/of/platform.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/of/platform.c b/drivers/of/platform.c index 36e25136e807..33cac801e50b 100644 --- a/drivers/of/platform.c +++ b/drivers/of/platform.c @@ -682,6 +682,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); } -- 2.22.0.709.g102302147b-goog