From patchwork Tue Jun 23 19:52:23 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 223567 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.0 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DE9D6C433DF for ; Tue, 23 Jun 2020 20:06:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id AF0352078A for ; Tue, 23 Jun 2020 20:06:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1592942816; bh=IdCbGn+BD/zSCajYpboxueiJwEpe9JU+/3rkeyZ6MkI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=oDaB2b9WibSnvwl63cKz8ip+ZS+OrfhZYa7guWAjIkRTyDaE7bojNBJRNWwJtriK2 KBK1019QYtZTfdoV1puizWBn1Lg7ZFPEy/llraLNKUDIG3d9FBSoxyzYJdwvK+6dbX iiSejzNQE4fG6qKLvo+/AK2QhX/EA3isDLrPryFc= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388542AbgFWUGz (ORCPT ); Tue, 23 Jun 2020 16:06:55 -0400 Received: from mail.kernel.org ([198.145.29.99]:47202 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388538AbgFWUGy (ORCPT ); Tue, 23 Jun 2020 16:06:54 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 339262078A; Tue, 23 Jun 2020 20:06:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1592942813; bh=IdCbGn+BD/zSCajYpboxueiJwEpe9JU+/3rkeyZ6MkI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=P4oPIOs3bIojw3cLPUurRYzH2bbqFkcGfcKyXeDz2LHs/VBqZkt23UAhm0gu1YIqH bE98XD4IjcOjkPdFkHoOZhu5450CF+0Yo8OIOQOYPzSI/sVzFD68u8We/HmEYhtHEr XJrCIvEVAKf+wCuK+QEqe9cbHeKBshqbFIW+ViMg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Nicolas Saenz Julienne , Saravana Kannan , Rob Herring , Sasha Levin Subject: [PATCH 5.7 146/477] of: property: Fix create device links for all child-supplier dependencies Date: Tue, 23 Jun 2020 21:52:23 +0200 Message-Id: <20200623195414.502212413@linuxfoundation.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200623195407.572062007@linuxfoundation.org> References: <20200623195407.572062007@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Nicolas Saenz Julienne [ Upstream commit ed3655729182a59b9bef1b564c6fc2dcbbbe954e ] Upon adding a new device from a DT node, we scan its properties and its children's properties in order to create a consumer/supplier relationship between the device and the property provider. That said, it's possible for some of the node's children to be disabled, which will create links that'll never be fulfilled. To get around this, use the for_each_available_child_of_node() function instead of for_each_available_node() when iterating over the node's children. Fixes: d4387cd11741 ("of: property: Create device links for all child-supplier depencencies") Signed-off-by: Nicolas Saenz Julienne Reviewed-by: Saravana Kannan Signed-off-by: Rob Herring Signed-off-by: Sasha Levin --- drivers/of/property.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/of/property.c b/drivers/of/property.c index b4916dcc9e725..a8c2b13521b27 100644 --- a/drivers/of/property.c +++ b/drivers/of/property.c @@ -1296,7 +1296,7 @@ static int of_link_to_suppliers(struct device *dev, if (of_link_property(dev, con_np, p->name)) ret = -ENODEV; - for_each_child_of_node(con_np, child) + for_each_available_child_of_node(con_np, child) if (of_link_to_suppliers(dev, child) && !ret) ret = -EAGAIN;